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

Brand (in PaymentMethod data) is reset after a failed binLookup #874

Merged
merged 3 commits into from
Mar 24, 2021

Conversation

sponglord
Copy link
Contributor

Summary

When card information is entered, and recognised by /binLookup, a brand property is set which will ultimately end up in the paymentMethod data submitted to the /payments endpoint.
However if the shopper then pastes a second card number directly into the field - the paymentMethod.brand will remain set to the previous card brand.
This PR ensures that if /binLookup fails to recognize the BIN for a second card then this brand property is reset.

Tested scenarios

Various e2e tests included to test the above scenario.
Also testing:

  • that for the Bancontact card component - a "reset" for an unrecognised card means the BCMC logo is once again displayed
  • for the generic Card component this "reset" ensures that the internal regex brand detection takes place on the card number

Fixed issue: COWEB-937

@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2021

Size Change: +261 B (0%)

Total Size: 459 kB

Filename Size Change
packages/lib/dist/adyen.js 147 kB +78 B (0%)
packages/lib/dist/cjs/index.js 143 kB +100 B (0%)
packages/lib/dist/es/index.js 82.9 kB +83 B (0%)
ℹ️ View Unchanged
Filename Size Change
packages/lib/dist/es/cs-CZ.js 3.8 kB 0 B
packages/lib/dist/es/da-DK.js 3.36 kB 0 B
packages/lib/dist/es/de-DE.js 3.76 kB 0 B
packages/lib/dist/es/el-GR.js 4.72 kB 0 B
packages/lib/dist/es/es-ES.js 3.54 kB 0 B
packages/lib/dist/es/fi-FI.js 3.55 kB 0 B
packages/lib/dist/es/fr-FR.js 3.68 kB 0 B
packages/lib/dist/es/hr-HR.js 3.58 kB 0 B
packages/lib/dist/es/hu-HU.js 3.78 kB 0 B
packages/lib/dist/es/it-IT.js 3.49 kB 0 B
packages/lib/dist/es/ja-JP.js 4.21 kB 0 B
packages/lib/dist/es/ko-KR.js 3.84 kB 0 B
packages/lib/dist/es/nl-NL.js 3.55 kB 0 B
packages/lib/dist/es/no-NO.js 3.37 kB 0 B
packages/lib/dist/es/pl-PL.js 3.84 kB 0 B
packages/lib/dist/es/pt-BR.js 3.53 kB 0 B
packages/lib/dist/es/ro-RO.js 3.71 kB 0 B
packages/lib/dist/es/ru-RU.js 4.48 kB 0 B
packages/lib/dist/es/sk-SK.js 3.86 kB 0 B
packages/lib/dist/es/sl-SI.js 3.46 kB 0 B
packages/lib/dist/es/sv-SE.js 3.5 kB 0 B
packages/lib/dist/es/zh-CN.js 3.75 kB 0 B
packages/lib/dist/es/zh-TW.js 3.91 kB 0 B

compressed-size-action

@sonarcloud
Copy link

sonarcloud bot commented Mar 23, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sponglord sponglord merged commit 8823256 into master Mar 24, 2021
@sponglord sponglord deleted the fix/reset_brand_after_failed_binLookup branch March 24, 2021 09:02
@sponglord sponglord mentioned this pull request Mar 29, 2021
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.

None yet

2 participants