Skip to content

Commit

Permalink
chore(deps): update to paypal-js@8.0.2 (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjopa committed Feb 28, 2024
1 parent df8f63b commit 6fa2ee4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 14 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -45,7 +45,7 @@
},
"homepage": "https://paypal.github.io/react-paypal-js/",
"dependencies": {
"@paypal/paypal-js": "^7.1.1",
"@paypal/paypal-js": "^8.0.2",
"@paypal/sdk-constants": "^1.0.122"
},
"devDependencies": {
Expand Down
16 changes: 12 additions & 4 deletions src/stories/payPalButtons/PayPalButtons.stories.tsx
Expand Up @@ -163,8 +163,12 @@ export const Default: FC<StoryProps> = ({
createOrder={() =>
createOrder([{ sku: "1blwyeo8", quantity: 1 }]).then(
(orderData) => {
action(ORDER_ID)(orderData.id);
return orderData.id;
if (orderData.id) {
action(ORDER_ID)(orderData.id);
return orderData.id;
} else {
throw new Error("failed to create Order Id");
}
}
)
}
Expand Down Expand Up @@ -193,8 +197,12 @@ export const Donate: FC<Omit<StoryProps, "showSpinner" | "fundingSource">> = ({
createOrder={() =>
createOrder([{ sku: "etanod01", quantity: 1 }]).then(
(orderData) => {
action(ORDER_ID)(orderData.id);
return orderData.id;
if (orderData.id) {
action(ORDER_ID)(orderData.id);
return orderData.id;
} else {
throw new Error("failed to create Order Id");
}
}
)
}
Expand Down
8 changes: 6 additions & 2 deletions src/stories/payPalMarks/PayPalMarks.stories.tsx
Expand Up @@ -112,8 +112,12 @@ export const RadioButtons: FC<{
createOrder={() =>
createOrder([{ sku: "1blwyeo8", quantity: 1 }]).then(
(orderData) => {
action(ORDER_ID)(orderData.id);
return orderData.id;
if (orderData.id) {
action(ORDER_ID)(orderData.id);
return orderData.id;
} else {
throw new Error("failed to create Order Id");
}
}
)
}
Expand Down
2 changes: 2 additions & 0 deletions src/stories/subscriptions/Subscriptions.stories.tsx
Expand Up @@ -62,9 +62,11 @@ const buttonOrderProps = () => ({
createOrder(data: Record<string, unknown>, actions: CreateOrderActions) {
return actions.order
.create({
intent: "CAPTURE",
purchase_units: [
{
amount: {
currency_code: "USD",
value: "2",
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/stories/subscriptions/code.ts
Expand Up @@ -17,9 +17,11 @@ const SUBSCRIPTION_OPTIONS = `createSubscription={(data, actions) => {
const CAPTURE_OPTIONS = `createOrder={function (data, actions) {
return actions.order
.create({
intent: "CAPTURE",
purchase_units: [
{
amount: {
currency_code: "USD",
value: "2",
},
},
Expand Down

0 comments on commit 6fa2ee4

Please sign in to comment.