Skip to content

Commit b61d662

Browse files
authored
Merge pull request #762 from paypal/feature/4085-useCardFieldsOneTimePayment
Feature/4085 use card fields one time payment
2 parents 29383be + 3ee0994 commit b61d662

File tree

8 files changed

+413
-154
lines changed

8 files changed

+413
-154
lines changed

.changeset/wild-singers-tan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@paypal/react-paypal-js": patch
3+
"@paypal/paypal-js": patch
4+
---
5+
6+
Created usePayPalCardFieldsOneTimePaymentSession hook

packages/paypal-js/types/v6/components/card-fields.d.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export type BillingAddress = {
118118
countryCode?: string;
119119
};
120120

121-
export type ExtraFields = {
121+
export type SubmitOptions = {
122122
name?: string;
123123
billingAddress?: BillingAddress;
124124
};
@@ -198,7 +198,10 @@ export type OneTimePaymentFlowResponse = {
198198
state: StateType;
199199
};
200200

201-
export type OneTimePaymentSubmitOptions = [orderId: string, data: ExtraFields];
201+
export type OneTimePaymentSubmitOptions = [
202+
orderId: string,
203+
data?: SubmitOptions,
204+
];
202205

203206
export type CardFieldsOneTimePaymentSession = BaseCardFieldsSession & {
204207
/**
@@ -233,7 +236,7 @@ export type SavePaymentFlowResponse = {
233236

234237
export type SavePaymentSubmitOptions = [
235238
vaultSetupToken: string,
236-
data: ExtraFields,
239+
data?: SubmitOptions,
237240
];
238241

239242
export type CardFieldsSavePaymentSession = BaseCardFieldsSession & {

0 commit comments

Comments
 (0)