-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(payments-plugin): Add multi-currency support for Braintree #3223
feat(payments-plugin): Add multi-currency support for Braintree #3223
Conversation
…nt UI currency selector
…Contribution guidelines
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
It seems to me that the Anyways let me know if I should open a new PR in a different format to avoid the merge conflict, or I should merge the minor to my fork first. |
…erti/vendure-dev into feat/braintree-multi-currency
Quality Gate failedFailed conditions |
Description
As briefly described in #3218, this PR adds new feature to the core BraintreePlugin, extending the plugin options with an optional object named
merchantAccountIds
.merchantAccountId
, thegateway.clientToken.generate()
andgateway.transaction.sale()
. Both of these methods accept themerchantAccountId
with typestring | undefined
. To look up the correctmerchantAccountId
to use, we are using the activeorder.currencyCode
and the plugin options. I did not implement heavy input error checks as the plugin option validity is evaluated runtime thanks to typescript.clientToken
generation and relying on the braintree-drop-in UI client side. Thebraintree-dev-server
sets up an Order, logs info for the developer and exposes theshopClient
and generatedclientToken
for a test plugin found under/fixtures/braintree-checkout-test.plugin.ts
.<div id="result"/>
.nonce
generated by the client drop-in UI doesn't have fake-currency-mismatch-nonce test value. The drop-in UI in the browser has to be manually completed and the value sent to the vendure server. I think the development server introduced here helps a lot in this, but I'm open for suggestions to make complete e2e here.Possible improvement
I think it's not optimal to add the
merchantAccountId
values during plugin initialisation, this would be better off as args for the payment handler itself. But I would rather wait for the newstruct
type to create the currency-merchantAccountId pairs as handler arguments to make it bullet-proof.Breaking changes
As far as I'm concerned, there are none.
Checklist
📌 Always:
👍 Most of the time: