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

Implement Stripe Multiple API Key #36

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kappa-london
Copy link

Changes

Add the ability to handle Stripe Multiple API Key based on currency available.

Configuration

Refer to the existing configuration options listed on ai-payments aimeos documentation

We added 1 static configuration (built-in/merged with existing config):

  • multiCurrency (boolean, optional)
    Accept 0/1, use 1 to enable multiple stripe account

We also added 2 dynamic configuration options (inserted manually through the admin panel)

  1. apiKey_{currency_code}

example option name: apiKey_AUD
value can be filled by the secret API key string from your Stripe account.

  1. publishableKey_{currency_code}

example option name: publishableKey_AUD
value can be filled by publishable API key string from your Stripe account.

Behavior

2 dynamic config values will be read by the system if multiCurrency was enabled. If enabled but system doesn’t detect related apiKey with currency in the shopping cart, system will use the default Stripe account (default value from apiKey and publishableKey)

Additional Notes

currency_code values taken from what aimeos locale currencies list (ISO 4217)

@kappa-london
Copy link
Author

Seems there's an issue with PHP setup on scrutinizer
I've tried to change composer.json on a few last commits but still can't pass the test due to a PHP issue on scrutinizer
Please kindly check and advise.

@aimeos
Copy link
Collaborator

aimeos commented Nov 23, 2021

Thank you for your PR!

Multiple Stripe configurations are already possible without your change. Just create two payment service options and use the "Currency" decorator to limit each one to the actual currency in the basket.

Thus, it makes no sense to merge you PR but we appreciate your work very much and hope you will add further improvments to the Aimeos code base :-)

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

Successfully merging this pull request may close these issues.

3 participants