adyen-web icon indicating copy to clipboard operation
adyen-web copied to clipboard

Click to Pay

Open ribeiroguilherme opened this issue 3 years ago • 2 comments

Summary

This is the umbrella branch which contains all commits/PR's related to Click to Pay.

How the Click to Pay initialization works in a nutshell:

  • The merchant account needs to be configured with the initialization values for Click to Pay SDK's. After doing that, /paymentMethods API response will return the Click to Pay initialization values used by the 3rd party SDK's, and the Card component will display the proper Component.
  • In order to configure the UI to show it, the merchant needs to explicitly set useClickToPay on Card configuration to enable it. Ex:
const adyenCheckout = checkout.create('card', {
    useClickToPay: true,
    ...
}).mount('#card-area');

Or, if using Drop-in:

const checkout = await AdyenCheckout({
    paymentMethodsConfiguration: {
        card: {
            useClickToPay: true,
        },
    },
    ...
}

const adyenCheckout = checkout.create('dropin').mount('#dropin-area')

There are two possibilities for the shopper to use this payment: the shopper has the Click to Pay cookies stored in his browser, or the shopper has a valid email which is registered in the Click to Pay system. If none of these cases are valid, then the default Card input fields is rendered.

In order to authenticate the shopper email in the Click to Pay system, the merchant has two different ways of passing the shopper email to Adyen Checkout:

  • If using 'sessions' , when creating the session, the merchant can pass the shopperEmail as part of the setup call
  • If using 'manual' flow, the merchant needs to provide the shopper email in the card component configuration object. Ex:
    card: {
        useClickToPay: true,
        clickToPayConfiguration: {
            shopperIdentityValue: '[email protected]'
        }
    },

If the shopper is identified (either by cookies or by email), the Click to Pay component is kept in the screen and the shopper can proceed with the payment.

ribeiroguilherme avatar Aug 12 '22 10:08 ribeiroguilherme

Size Change: +33.3 kB (+4%)

Total Size: 845 kB

Filename Size Change
packages/lib/dist/adyen.js 225 kB +9.26 kB (+4%)
packages/lib/dist/cjs/index.js 193 kB +8.87 kB (+5%) 🔍
packages/lib/dist/es.modern/index.js 103 kB +6.7 kB (+7%) 🔍
packages/lib/dist/es/index.js 120 kB +8.5 kB (+8%) 🔍
ℹ️ View Unchanged
Filename Size
packages/lib/dist/es.modern/ar.js 4.61 kB
packages/lib/dist/es.modern/cs-CZ.js 4.13 kB
packages/lib/dist/es.modern/da-DK.js 3.74 kB
packages/lib/dist/es.modern/de-DE.js 4.04 kB
packages/lib/dist/es.modern/el-GR.js 5.13 kB
packages/lib/dist/es.modern/es-ES.js 3.79 kB
packages/lib/dist/es.modern/fi-FI.js 3.83 kB
packages/lib/dist/es.modern/fr-FR.js 3.98 kB
packages/lib/dist/es.modern/hr-HR.js 3.91 kB
packages/lib/dist/es.modern/hu-HU.js 4.1 kB
packages/lib/dist/es.modern/it-IT.js 3.79 kB
packages/lib/dist/es.modern/ja-JP.js 4.56 kB
packages/lib/dist/es.modern/ko-KR.js 4.16 kB
packages/lib/dist/es.modern/nl-NL.js 3.81 kB
packages/lib/dist/es.modern/no-NO.js 3.73 kB
packages/lib/dist/es.modern/pl-PL.js 4.17 kB
packages/lib/dist/es.modern/pt-BR.js 3.81 kB
packages/lib/dist/es.modern/pt-PT.js 3.94 kB
packages/lib/dist/es.modern/ro-RO.js 4.03 kB
packages/lib/dist/es.modern/ru-RU.js 4.83 kB
packages/lib/dist/es.modern/sk-SK.js 4.17 kB
packages/lib/dist/es.modern/sl-SI.js 3.82 kB
packages/lib/dist/es.modern/sv-SE.js 3.76 kB
packages/lib/dist/es.modern/zh-CN.js 4.07 kB
packages/lib/dist/es.modern/zh-TW.js 4.22 kB
packages/lib/dist/es/ar.js 4.61 kB
packages/lib/dist/es/cs-CZ.js 4.13 kB
packages/lib/dist/es/da-DK.js 3.74 kB
packages/lib/dist/es/de-DE.js 4.04 kB
packages/lib/dist/es/el-GR.js 5.13 kB
packages/lib/dist/es/es-ES.js 3.79 kB
packages/lib/dist/es/fi-FI.js 3.83 kB
packages/lib/dist/es/fr-FR.js 3.98 kB
packages/lib/dist/es/hr-HR.js 3.91 kB
packages/lib/dist/es/hu-HU.js 4.1 kB
packages/lib/dist/es/it-IT.js 3.79 kB
packages/lib/dist/es/ja-JP.js 4.56 kB
packages/lib/dist/es/ko-KR.js 4.16 kB
packages/lib/dist/es/nl-NL.js 3.81 kB
packages/lib/dist/es/no-NO.js 3.73 kB
packages/lib/dist/es/pl-PL.js 4.17 kB
packages/lib/dist/es/pt-BR.js 3.81 kB
packages/lib/dist/es/pt-PT.js 3.94 kB
packages/lib/dist/es/ro-RO.js 4.03 kB
packages/lib/dist/es/ru-RU.js 4.83 kB
packages/lib/dist/es/sk-SK.js 4.17 kB
packages/lib/dist/es/sl-SI.js 3.82 kB
packages/lib/dist/es/sv-SE.js 3.76 kB
packages/lib/dist/es/zh-CN.js 4.07 kB
packages/lib/dist/es/zh-TW.js 4.22 kB

compressed-size-action

github-actions[bot] avatar Aug 12 '22 10:08 github-actions[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
1.8% 1.8% Duplication

sonarqubecloud[bot] avatar Aug 23 '22 08:08 sonarqubecloud[bot]