-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #181 from commercetools/joey-koster-ct/SCC-2462-ad…
…d-bancontact-mobile-support feat(enabler/processor): add Bancontact Mobile support
- Loading branch information
Showing
9 changed files
with
85 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
enabler/src/components/payment-methods/bancontactcard-mobile.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import Core from "@adyen/adyen-web/dist/types/core/core"; | ||
import { | ||
ComponentOptions, | ||
PaymentComponent, | ||
PaymentMethod, | ||
} from "../../payment-enabler/payment-enabler"; | ||
import { | ||
AdyenBaseComponentBuilder, | ||
DefaultAdyenComponent, | ||
BaseOptions, | ||
} from "../base"; | ||
|
||
/** | ||
* Bancontact card component | ||
* | ||
* Configuration options: | ||
* https://docs.adyen.com/payment-methods/bancontact/bancontact-mobile/web-component | ||
*/ | ||
export class BancontactMobileBuilder extends AdyenBaseComponentBuilder { | ||
constructor(baseOptions: BaseOptions) { | ||
super(PaymentMethod.bancontactmobile, baseOptions); | ||
} | ||
|
||
build(config: ComponentOptions): PaymentComponent { | ||
const bancontactmobileComponent = new BancontactMobileComponent({ | ||
paymentMethod: this.paymentMethod, | ||
adyenCheckout: this.adyenCheckout, | ||
componentOptions: config, | ||
sessionId: this.sessionId, | ||
processorUrl: this.processorUrl, | ||
}); | ||
bancontactmobileComponent.init(); | ||
return bancontactmobileComponent; | ||
} | ||
} | ||
|
||
export class BancontactMobileComponent extends DefaultAdyenComponent { | ||
constructor(opts: { | ||
paymentMethod: PaymentMethod; | ||
adyenCheckout: typeof Core; | ||
componentOptions: ComponentOptions; | ||
sessionId: string; | ||
processorUrl: string; | ||
}) { | ||
super(opts); | ||
} | ||
|
||
init() { | ||
this.component = this.adyenCheckout.create(this.paymentMethod, { | ||
showPayButton: this.componentOptions.showPayButton, | ||
}); | ||
} | ||
|
||
showValidation() { | ||
this.component.showValidation(); | ||
} | ||
|
||
isValid() { | ||
return this.component.isValid; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters