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

Bancontact - Using 'bcmc' instead of 'scheme' for paymentMethod.type #2286

Merged
5 changes: 5 additions & 0 deletions .changeset/metal-frogs-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@adyen/adyen-web': minor
---

Bancontact now returns paymentMethod.type 'bcmc' instead of 'scheme'
10 changes: 9 additions & 1 deletion packages/lib/src/components/Card/Bancontact.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { CardElement } from './Card';
import { CardElementProps } from './types';
import { CardElementData, CardElementProps } from './types';
import { CVC_POLICY_HIDDEN } from '../internal/SecuredFields/lib/configuration/constants';

class BancontactElement extends CardElement {
public static type = 'bcmc';

constructor(props: CardElementProps) {
super(props);
}
Expand All @@ -12,6 +14,12 @@ class BancontactElement extends CardElement {
brands: ['bcmc', 'maestro', 'visa']
};

formatData(): CardElementData {
const data = super.formatData();
data.paymentMethod.type = this.constructor['type'];
return data;
}

/**
* Now that the Bancontact (BCMC) Card component can accept a number dual branded with Visa (which requires a CVC) it has to be handled differently
* at creation time (no automatic removing of the CVC securedField).
Expand Down
Loading