submitPaymentDetails
Method mounting an Adyen drop-in in the specified DOM element in order to handle the redirect's result.
The method takes the sessionId and redirectResult (that has been attached as a URL query parameters by Adyen while redirecting back from the external payment page) and creates an AdyenCheckout instance, mounts the drop-in component in specified DOM element, and calls submitDetails method.
Signature
export declare function submitPaymentDetails(
props: SubmitPaymentDetailsProperties
): Promise<SubmitPaymentDetailsResult>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
props | Required | SubmitPaymentDetailsProperties | Parameter object which can be used with this method. Refer to its type definition to learn about possible properties. |
Returns
Returns Promise<void>
Referenced Types
Examples
Handling redirect's result
import { sdk } from '~/sdk.config.ts';
const { sessionId, redirectResult } = // read it from the URL query params
await sdk.adyen.submitPaymentDetails({
sessionId,
redirectResult,
paymentDOMElement: "#payment-element",
adyenConfiguration: {
async onPaymentCompleted(result, component) {
// place an order & redirect to the thank you page
},
onError(error, component) {
// handle error
}
},
});