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

🧠🌴 Remove dependency from braintree-web CDN #3206

Merged
merged 6 commits into from Feb 15, 2023

Conversation

josemigallas
Copy link
Contributor

@josemigallas josemigallas commented Feb 9, 2023

What this PR does / why we need it:

Remove dependency from braintree-web sdk loaded via CDN by moving the script into a TS file handled by webpack.

Additionally there are some minor improvements, namely:

  • Disable the submit button once click to avoid multiple form submissions.
  • Move css to a scss file (some typos have been spotted).
  • Move hosted fields styles and options to a separate utils file, which will be reused by same form in dev portal.
  • Show potential errors in console to help future debugging.

Possible scenarios:

  • Scenarios 1: hosted fields failure
    braintree-error

  • Scenario 2: wrong client token

  • Scenario 3: wrong credit card

  • Scenario 4: braintree error after submission

Which issue(s) this PR fixes

THREESCALE-9152: Remove double dependency from braintree-web SDK

Verification steps

You can verify it still works by going to Account Settings > Billing > Payment Details > edit
(AKA /p/admin/account/braintree_blue/edit)

Then use any of the Braintree test credit cards, such as: 4000000000001000 with any valid exp. date and CVV.

NOTE: you will need to have your gateway configured in master (see test credentials in Bitwarden).

@josemigallas josemigallas self-assigned this Feb 9, 2023
@josemigallas josemigallas changed the title 🧠🌴 Remove dependency from braintree-web CDN 🚧🧠🌴 Remove dependency from braintree-web CDN Feb 9, 2023
lvillen
lvillen previously approved these changes Feb 13, 2023
jlledom
jlledom previously approved these changes Feb 15, 2023
Copy link
Contributor

@jlledom jlledom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried locally and seems to work fine

@josemigallas josemigallas changed the title 🚧🧠🌴 Remove dependency from braintree-web CDN 🧠🌴 Remove dependency from braintree-web CDN Feb 15, 2023
@josemigallas josemigallas merged commit 82a623b into master Feb 15, 2023
@josemigallas josemigallas deleted the braintree_provider_form branch February 15, 2023 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants