From 38b5f0eeb9bce55cdda8d35d1e6716a69ee39948 Mon Sep 17 00:00:00 2001 From: andrewbents Date: Tue, 12 Nov 2024 16:33:55 +0100 Subject: [PATCH 1/2] Revert "Add orderId to success/error callbacks (#88)" This reverts commit f26a2a13f9d9a2b3fd3fc4c1bd2c2a3548687ad3. --- src/types.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/types.ts b/src/types.ts index d4078fc..79d3b96 100644 --- a/src/types.ts +++ b/src/types.ts @@ -426,12 +426,9 @@ export interface CommonOptions { /** Controls the language of the text in the widget method */ locale?: Locale | 'auto' /** Callback will be called when the payment is completed successfully */ - onSuccess?: (payload: { orderId: string }) => void + onSuccess?: () => void /** Callback if transaction is failed to complete, the reason should be available in the message parameter */ - onError?: ( - error: RevolutCheckoutError, - payload: { orderId: string | undefined } - ) => void + onError?: (error: RevolutCheckoutError) => void /** Callback if an user did not complete the transaction and canceled the authorisation or closed the checkout window */ onCancel?: () => void /** Indicates in which case this saved payment method can be used for payments */ @@ -639,14 +636,9 @@ export type RevolutPayEvents = payload: | { type: 'success' - orderId: string - } - | { type: 'error'; error: RevolutCheckoutError; orderId: string } - | { - type: 'cancel' - dropOffState: RevolutPayDropOffState - orderId?: string } + | { type: 'error'; error: RevolutCheckoutError } + | { type: 'cancel'; dropOffState: RevolutPayDropOffState } } | { type: 'click' From d348013748621d537355aa447e575cf1733ff4dd Mon Sep 17 00:00:00 2001 From: andrewbents Date: Tue, 12 Nov 2024 16:35:25 +0100 Subject: [PATCH 2/2] restore revolut pay events --- src/types.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index 79d3b96..6de6461 100644 --- a/src/types.ts +++ b/src/types.ts @@ -636,9 +636,14 @@ export type RevolutPayEvents = payload: | { type: 'success' + orderId: string + } + | { type: 'error'; error: RevolutCheckoutError; orderId: string } + | { + type: 'cancel' + dropOffState: RevolutPayDropOffState + orderId?: string } - | { type: 'error'; error: RevolutCheckoutError } - | { type: 'cancel'; dropOffState: RevolutPayDropOffState } } | { type: 'click'