sbarbat / SyliusSagepayPlugin

The Sylius Sagepay Gateway Plugin
MIT License
3 stars 8 forks source link

FR: use currency from order #7

Closed acornforth closed 4 years ago

acornforth commented 4 years ago

I don't know exactly how feasible this is just yet, or if there is an important design decision behind the current behaviour, but i would be willing to submit a PR if we can agree that this is a good feature to add....

On our store we have 4 channels, each uses a different currency (GBP USD CAD and EUR). With the current version of this plugin, if is is enable for all channels, it always tried to checkout in the same currency (whatever is configured in the gateway options, in our case GBP). unfortunately no conversion takes place, so we had the issue where a customer checking out with a cart worth CA$199.99 ends up on sagepay payment page with a value of GB£199.99, obviously this is not the same amount!

The workaround we are using is fine for now, and acceptable for our use case. It involves configuring a separate payment method for each channel on our store, each configured to the correct currency for that channel.

I propose a better solution would be for the plugin to grab the currency from the order Entity. then only one payment would need to be configure for all channels

sbarbat commented 4 years ago

@acornforth that's a good point but I think on the last updates we changed that. Check here and here if that's what you meant.

Are you using the last version on master on your project?

acornforth commented 4 years ago

@sbarbat you are correct, the version we are using was out-of-date by a few months, we had to tweak it as we have customised sylius to store currencies with more precision, that's why we didn't already update it.

Out of interest, do you have any plans to support Saved-Card Tokens in the future ?

sbarbat commented 4 years ago

@acornforth I'm not using the plugin at the moment, but I'll make you a contributor so you can implement the "Saved card tokens" with ease 👍