sveawebpay / php-integration

SDK for Sveas payment methods (standalone and Svea Checkout)
Other
15 stars 19 forks source link

Dynamic MerchantId and Secret in config #73

Closed itssimple closed 7 years ago

itssimple commented 7 years ago

I'm making a plugin to our WordPress-plugin to handle SveaWebPay.

To make it easy for our customers who also use SveaWebPay, can I use ConfigurationService::getProdConfig() and modify the commonCredentials and checkoutCredentials with the merchantid and secret?

Because I cannot make a new config-file for each customer that wants to use the plugin. :) I want them to be able to set this themselves, in the plugin settings, in WordPress

nlii commented 7 years ago

You should implement the ConfigurationProvider interface. Implement every function to return the value saved in your store configuration. See example from our module from Opencart - Opencart configurationProvider implementation

itssimple commented 7 years ago

Thanks, will get right on it!

itssimple commented 7 years ago

Is there a difference between checkout and normal merchant details? So I know if I can return the same values or if I need different values stored.

fre-sund commented 7 years ago

The difference between them is that commonCredentials are used for card payments and direct banking only, whilst checkoutCredentials are used for Svea Checkout which includes all the payment methods that is provided by Svea in one flow.

The credentials cannot be mixed i.e. the checkoutCredentials cannot be used as commonCredentials.

Which one of the credentials that is used by the customer is determined by what's on the agreement that is signed between Svea and the customer. It will be very uncommon for customers to use both commonCredentials and checkoutCredentials at the same time as each other, however it's possible but two different agreements needs to be signed in that case.

Also sorry for the late response. :(