Skip to content

Commit 4208122

Browse files
add package-lock and remove custom components in favor or static ui (#157)
1 parent 0fd1d50 commit 4208122

File tree

10 files changed

+2482
-134
lines changed

10 files changed

+2482
-134
lines changed

client/prebuiltPages/react/package-lock.json

Lines changed: 2460 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/prebuiltPages/react/src/payments/oneTimePayment/components/PayLaterButton.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

client/prebuiltPages/react/src/payments/oneTimePayment/components/PayPalBasicCardButton.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

client/prebuiltPages/react/src/payments/oneTimePayment/components/PayPalButton.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

client/prebuiltPages/react/src/payments/oneTimePayment/components/VenmoButton.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

client/prebuiltPages/react/src/payments/oneTimePayment/pages/Checkout.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ import {
77
type OnErrorData,
88
type OnCompleteData,
99
type OnCancelDataOneTimePayments,
10+
PayPalOneTimePaymentButton,
11+
VenmoOneTimePaymentButton,
12+
PayLaterOneTimePaymentButton,
13+
PayPalGuestPaymentButton,
1014
} from "@paypal/react-paypal-js/sdk-v6";
11-
import PayPalButton from "../components/PayPalButton";
12-
import VenmoButton from "../components/VenmoButton";
13-
import PayLaterButton from "../components/PayLaterButton";
14-
import PayPalBasicCardButton from "../components/PayPalBasicCardButton";
15-
import PayPalCreditOneTimeButton from "../components/PayPalCreditOneTimeButton";
1615
import BaseCheckout from "../../../pages/BaseCheckout";
1716
import type { ModalType, ModalContent, ProductItem } from "../../../types";
1817
import { captureOrder, createOrder } from "../../../utils";
@@ -102,34 +101,28 @@ const Checkout = () => {
102101
</div>
103102
) : (
104103
<>
105-
<PayPalButton
104+
<PayPalOneTimePaymentButton
106105
createOrder={handleCreateOrder}
107106
presentationMode="auto"
108107
{...handlePaymentCallbacks}
109108
/>
110109

111-
<VenmoButton
110+
<VenmoOneTimePaymentButton
112111
createOrder={handleCreateOrder}
113112
presentationMode="auto"
114113
{...handlePaymentCallbacks}
115114
/>
116115

117-
<PayLaterButton
116+
<PayLaterOneTimePaymentButton
118117
createOrder={handleCreateOrder}
119118
presentationMode="auto"
120119
{...handlePaymentCallbacks}
121120
/>
122121

123-
<PayPalBasicCardButton
122+
<PayPalGuestPaymentButton
124123
createOrder={handleCreateOrder}
125124
{...handlePaymentCallbacks}
126125
/>
127-
128-
<PayPalCreditOneTimeButton
129-
createOrder={handleCreateOrder}
130-
presentationMode="auto"
131-
{...handlePaymentCallbacks}
132-
/>
133126
</>
134127
);
135128

client/prebuiltPages/react/src/payments/oneTimePayment/pages/StaticButtons.tsx

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import {
66
type OnCompleteData,
77
type OnErrorData,
88
type OnCancelDataOneTimePayments,
9+
PayPalOneTimePaymentButton,
10+
VenmoOneTimePaymentButton,
11+
PayLaterOneTimePaymentButton,
12+
PayPalGuestPaymentButton,
913
} from "@paypal/react-paypal-js/sdk-v6";
10-
import PayPalButton from "../components/PayPalButton";
11-
import VenmoButton from "../components/VenmoButton";
12-
import PayLaterButton from "../components/PayLaterButton";
13-
import PayPalBasicCardButton from "../components/PayPalBasicCardButton";
14-
import PayPalCreditOneTimeButton from "../components/PayPalCreditOneTimeButton";
1514
import BaseStaticButtons from "../../../pages/BaseStaticButtons";
1615
import type { ModalType, ModalContent, ProductItem } from "../../../types";
1716
import { captureOrder, createOrder } from "../../../utils";
@@ -33,8 +32,8 @@ const StaticButtons = () => {
3332
setModalState("cancel");
3433
},
3534

36-
onError: (error: OnErrorData) => {
37-
console.error("Payment error:", error);
35+
onError: (data: OnErrorData) => {
36+
console.error("Payment error:", data);
3837
setModalState("error");
3938
},
4039

@@ -95,34 +94,28 @@ const StaticButtons = () => {
9594

9695
return (
9796
<>
98-
<PayPalButton
97+
<PayPalOneTimePaymentButton
9998
createOrder={() => handleCreateOrder(products)}
10099
presentationMode="auto"
101100
{...handlePaymentCallbacks}
102101
/>
103102

104-
<VenmoButton
103+
<VenmoOneTimePaymentButton
105104
createOrder={() => handleCreateOrder(products)}
106105
presentationMode="auto"
107106
{...handlePaymentCallbacks}
108107
/>
109108

110-
<PayLaterButton
109+
<PayLaterOneTimePaymentButton
111110
createOrder={() => handleCreateOrder(products)}
112111
presentationMode="auto"
113112
{...handlePaymentCallbacks}
114113
/>
115114

116-
<PayPalBasicCardButton
115+
<PayPalGuestPaymentButton
117116
createOrder={() => handleCreateOrder(products)}
118117
{...handlePaymentCallbacks}
119118
/>
120-
121-
<PayPalCreditOneTimeButton
122-
createOrder={() => handleCreateOrder(products)}
123-
presentationMode="auto"
124-
{...handlePaymentCallbacks}
125-
/>
126119
</>
127120
);
128121
};

client/prebuiltPages/react/src/payments/savePayment/components/PayPalSaveButton.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

client/prebuiltPages/react/src/payments/savePayment/pages/Checkout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
type OnCompleteData,
66
type OnErrorData,
77
type OnCancelDataSavePayments,
8+
PayPalSavePaymentButton,
89
} from "@paypal/react-paypal-js/sdk-v6";
9-
import PayPalSaveButton from "../components/PayPalSaveButton";
1010
import PayPalCreditSaveButton from "../components/PayPalCreditSaveButton";
1111
import BaseCheckout from "../../../pages/BaseCheckout";
1212
import type { ModalType, ModalContent } from "../../../types";
@@ -76,7 +76,7 @@ const Checkout = () => {
7676
const paymentButtons = (
7777
<>
7878
<div>
79-
<PayPalSaveButton
79+
<PayPalSavePaymentButton
8080
createVaultToken={createVaultToken}
8181
presentationMode="auto"
8282
{...handleSaveCallbacks}

client/prebuiltPages/react/src/payments/savePayment/pages/StaticButtons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {
44
type OnCompleteData,
55
type OnCancelDataSavePayments,
66
type OnErrorData,
7+
PayPalSavePaymentButton,
78
} from "@paypal/react-paypal-js/sdk-v6";
8-
import PayPalSaveButton from "../components/PayPalSaveButton";
99
import PayPalCreditSaveButton from "../components/PayPalCreditSaveButton";
1010
import BaseStaticButtons from "../../../pages/BaseStaticButtons";
1111
import type { ModalType, ModalContent } from "../../../types";
@@ -68,7 +68,7 @@ const StaticButtons = () => {
6868
return (
6969
<>
7070
<div>
71-
<PayPalSaveButton
71+
<PayPalSavePaymentButton
7272
createVaultToken={createVaultToken}
7373
presentationMode="auto"
7474
{...handleSaveCallbacks}

0 commit comments

Comments
 (0)