Skip to content

Commit

Permalink
Add orderId to success/error callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Bents committed Nov 6, 2024
1 parent 040890f commit 3bd2427
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +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?: () => void
onSuccess?: (payload: { orderId: string }) => void
/** Callback if transaction is failed to complete, the reason should be available in the message parameter */
onError?: (error: RevolutCheckoutError) => void
onError?: (error: RevolutCheckoutError, payload: { orderId: OrderToken | undefined }) => void

Check failure on line 431 in src/types.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `error:·RevolutCheckoutError,·payload:·{·orderId:·OrderToken·|·undefined·}` with `⏎····error:·RevolutCheckoutError,⏎····payload:·{·orderId:·OrderToken·|·undefined·}⏎··`
/** 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 */
Expand Down Expand Up @@ -636,9 +636,10 @@ export type RevolutPayEvents =
payload:
| {
type: 'success'
orderId: string
}
| { type: 'error'; error: RevolutCheckoutError }
| { type: 'cancel'; dropOffState: RevolutPayDropOffState }
| { type: 'error'; error: RevolutCheckoutError; orderId: string }
| { type: 'cancel'; dropOffState: RevolutPayDropOffState; orderId?: string }

Check failure on line 642 in src/types.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `·type:·'cancel';·dropOffState:·RevolutPayDropOffState;·orderId?:·string` with `⏎············type:·'cancel'⏎············dropOffState:·RevolutPayDropOffState⏎············orderId?:·string⏎·········`
}
| {
type: 'click'
Expand Down

0 comments on commit 3bd2427

Please sign in to comment.