Some payment methods require the shopper to complete additional actions. For example, they must scan a QR code, authenticate a payment with 3D Secure, or go to an external app to complete the payment. After the shopper completes the additional action, you can synchronously get the payment result.
You always receive a notification webhook with the payment result asynchronously. We recommend that you use this to accurately update your order management system.
Before you begin
This page assumes you've already built a Drop-in integration.
Step 1. Implement the method to submit additional details
The Drop-in session
calls handlerForAdditionalDetails
.
The following example shows an implementation that handles, for example, the 3D Secure 2 action:
- If the
component
type isThreeDS2Component
, the method returns an instance ofAdyenSessionPaymentDetailsHandler
. - The
session
callsdidProvide
frommyPaymentDetailsHandlerInstance
to submit additional data from theThreeDS2Component
in a /payments/details request.
// Create a type that conforms to AdyenSessionPaymentDetailsHandler.
// Implement this in AdyenSessionDelegate.
func handlerForAdditionalDetails(in component: ActionComponent,
session: AdyenSession) -> AdyenSessionPaymentDetailsHandler? {
if component is ThreeDS2Component {
// This instance has the didProvide method that the AdyenSession calls.
return myPaymentDetailsHandlerInstance
}
// AdyenSession handles the flow. No additional API request.
return nil
}
Step 2. Implement the method of the payment details handler to make the API request
The Drop-in session
calls didProvide
from AdyenSessionPaymentDetailsHandler
, making a /payments/details request from your server with required data:
Step 3: Show the payment result
Use the resultCode
from the /payments or /payments/details response to show the payment result to the shopper.