3DS and redirects (pay-threeds)
Reference for the module that pays from an activity, with the 3DS and redirect screens it shows, their string resource, and its manifest entries.
pay-threeds shows the screens a payment may need over your activity, and gives PayCheckout the pay function apps call. Its package is com.pay.sdk.threeds. It brings in pay-core, and uses AndroidX Activity, Browser, and Lifecycle.
| API | Description |
|---|---|
checkout.pay(request, activity) | Pays, showing the 3DS steps and redirects over the activity. Import it with import com.pay.sdk.threeds.pay. |
What the SDK shows describes each screen during a payment.
The 3DS challenge screen
The challenge runs in a WebView with JavaScript, DOM storage, and third-party cookies on, and file and content access off. It may go to any web address, since the issuer's pages can be on any domain. The SDK catches the navigation to your returnUrl, and blocks links that would open another app. The Cancel button and the back button end the challenge as canceled.
Redirects
The SDK opens the payment method's page in a Custom Tab, with sharing off. The redirect ends when your app passes the return URL to PayCheckout.handleReturn(). When the customer comes back to your app without one, the SDK waits 750 milliseconds after your activity resumes, then ends the redirect as canceled.
Resources
The module has one string resource you can override.
| Resource | Default | Description |
|---|---|---|
pay_threeds_challenge_title | Verification | The 3DS challenge screen's title. Override it in your app's resources to change or translate it. |
Manifest
The module's manifest adds to your app's:
- The
INTERNETpermission. - A
queriesentry for Custom Tabs services, so the SDK can open a Custom Tab on Android 11 and later.
Your activity also needs an intent filter for your returnUrl. See Handle the return URL.