Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to use the 'language' parameter #102

Closed
benjam-es opened this issue Jul 4, 2018 · 8 comments
Closed

Add the ability to use the 'language' parameter #102

benjam-es opened this issue Jul 4, 2018 · 8 comments

Comments

@benjam-es
Copy link
Contributor

Are there any plans to allow the 'Language' parameter (possibly using 'localeCode' in the same way the paypal gateway does)?

This is useful for multilanguage websites

judgej added a commit that referenced this issue Jul 4, 2018
@judgej
Copy link
Member

judgej commented Jul 4, 2018

Good point. Not got time to finish it off today (or maybe this week) but check out the https://github.com/thephpleague/omnipay-sagepay/tree/issue102 branch. You can use the language parameter to set the language using the ISO639 aplha-2 code (e.g. gb or GB), or even a locale (e.g. de-DE).

This is a branch from master, which is aliased to Omnipay version 3.x (and get the tests working - just noticed they failed).

Let me know if this works for you, port the changes to 2,x if you want, and I'll finish it off and document it.

@benjam-es
Copy link
Contributor Author

Sorry, just noticed your reply after creating a pull request.

@judgej
Copy link
Member

judgej commented Jul 4, 2018

No problem, we can merge the best bits of each :-)

Just a tip on PRs: try to keep formatting and typos separate from functional changes. Both are great and just as important, but it means non-functional changes can be merged in with no effort and no dependencies, and are not held back by tweaks to functional changes. And if a functional change needs to be reversed due to some unforeseen effects later, then we don't end up reversing all the formatting. Both good though :-)

@benjam-es
Copy link
Contributor Author

Thanks. I have tried out your new branch, but the payment pages are not yet displaying in the requested language. I have contacted sagepay for them to check to see if it is an issue at their end.

@judgej
Copy link
Member

judgej commented Jul 4, 2018

I've not tried it end-to-end yet - just created a test to check the Language field is in the data that is sent for both Direct and Server APIs.

@judgej
Copy link
Member

judgej commented Jul 4, 2018

This is with 'language' => 'fr' on the gateway:

image

Also the same with the language set at the purchase([]) creation.

Obviously the cart description should have been "pizzas pour tout le monde".

@benjam-es
Copy link
Contributor Author

Change the sagepay template back to the default one - and this worked. Thanks.

I look forward to the 3.0.x release.

@judgej
Copy link
Member

judgej commented Jul 11, 2018

This is now released as version 3.0.1. Could you please close this issue when you are happy it is working as expected. I have a bit of refactoring to do here next (some traits to reduce duplication of methods) but is would be nice to see this completely closed first. Thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants