Skip to content

Commit

Permalink
add onCancel to card-field
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai-Yen Nguyen committed Jan 17, 2025
1 parent 37ef35d commit 25fa9d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silly-bears-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@paypal/paypal-js": major
---

create new type for createOrder, createVaultToken and add onCancel to card-field
4 changes: 2 additions & 2 deletions packages/paypal-js/types/components/card-fields.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export interface PayPalCardFieldsIndividualField {
export interface PayPalCardFieldsComponentBasics {
onApprove: (data: CardFieldsOnApproveData) => void;
onError: (err: Record<string, unknown>) => void;
onCancel?: () => Promise<void> | void;
inputEvents?: PayPalCardFieldsInputEvents;
style?: Record<string, PayPalCardFieldsStyleOptions>;
}
Expand All @@ -150,8 +151,7 @@ export type PayPalCardFieldsComponentOptions =
| PayPalCardFieldsComponentCreateOrder
| PayPalCardFieldsComponentCreateVaultSetupToken;

export interface PayPalCardFieldsComponent
extends PayPalCardFieldsComponentOptions {
export interface PayPalCardFieldsComponent {
getState: () => Promise<PayPalCardFieldsStateObject>;
isEligible: () => boolean;
submit: () => Promise<void>;
Expand Down

0 comments on commit 25fa9d1

Please sign in to comment.