@pelcro/react-pelcro-js 3.26.0-beta.8 → 3.26.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +14 -53
- package/dist/index.esm.js +14 -53
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -21180,11 +21180,10 @@ const ApplePayButton = _ref => {
|
|
|
21180
21180
|
invoice
|
|
21181
21181
|
} = usePelcro();
|
|
21182
21182
|
const {
|
|
21183
|
-
payPageId,
|
|
21184
|
-
reportGroup,
|
|
21183
|
+
pay_page_id: payPageId,
|
|
21184
|
+
report_group: reportGroup,
|
|
21185
21185
|
apple_pay_merchant_id: ApplePayMerchantId,
|
|
21186
|
-
apple_pay_enabled: ApplePayEnabled
|
|
21187
|
-
apple_pay_billing_agreement: ApplePayBillingAgreement
|
|
21186
|
+
apple_pay_enabled: ApplePayEnabled
|
|
21188
21187
|
} = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
|
|
21189
21188
|
const updatedPrice = (_ref2 = (_ref3 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : props === null || props === void 0 ? void 0 : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref3 !== void 0 ? _ref3 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining;
|
|
21190
21189
|
React.useEffect(() => {
|
|
@@ -21224,35 +21223,9 @@ const ApplePayButton = _ref => {
|
|
|
21224
21223
|
supportedNetworks: ["visa", "masterCard", "amex", "discover"],
|
|
21225
21224
|
total: {
|
|
21226
21225
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21226
|
+
type: "final",
|
|
21227
21227
|
amount: updatedPrice / 100
|
|
21228
|
-
}
|
|
21229
|
-
lineItems: [plan !== null && plan !== void 0 && plan.auto_renew ? {
|
|
21230
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21231
|
-
amount: updatedPrice / 100,
|
|
21232
|
-
paymentTiming: "recurring",
|
|
21233
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21234
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21235
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21236
|
-
} : {
|
|
21237
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21238
|
-
amount: updatedPrice / 100
|
|
21239
|
-
}],
|
|
21240
|
-
...((plan === null || plan === void 0 ? void 0 : plan.auto_renew) && {
|
|
21241
|
-
recurringPaymentRequest: {
|
|
21242
|
-
paymentDescription: "A description of the recurring payment to display to the user in the payment sheet.",
|
|
21243
|
-
regularBilling: {
|
|
21244
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21245
|
-
amount: updatedPrice / 100,
|
|
21246
|
-
paymentTiming: "recurring",
|
|
21247
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21248
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21249
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21250
|
-
},
|
|
21251
|
-
billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
|
|
21252
|
-
managementURL: "https://applepaydemo.apple.com",
|
|
21253
|
-
tokenNotificationURL: "https://applepaydemo.apple.com"
|
|
21254
|
-
}
|
|
21255
|
-
})
|
|
21228
|
+
}
|
|
21256
21229
|
};
|
|
21257
21230
|
console.log(ApplePayPaymentRequest);
|
|
21258
21231
|
// Create ApplePaySession
|
|
@@ -21298,17 +21271,12 @@ const ApplePayButton = _ref => {
|
|
|
21298
21271
|
// No updates or errors are needed, pass an empty object.
|
|
21299
21272
|
const newTotal = {
|
|
21300
21273
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21274
|
+
type: "final",
|
|
21301
21275
|
amount: updatedPrice / 100
|
|
21302
21276
|
};
|
|
21303
|
-
const newLineItems = [
|
|
21304
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21305
|
-
amount: updatedPrice / 100,
|
|
21306
|
-
paymentTiming: "recurring",
|
|
21307
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21308
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21309
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21310
|
-
} : {
|
|
21277
|
+
const newLineItems = [{
|
|
21311
21278
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21279
|
+
type: "final",
|
|
21312
21280
|
amount: updatedPrice / 100
|
|
21313
21281
|
}];
|
|
21314
21282
|
session.completePaymentMethodSelection(newTotal, newLineItems);
|
|
@@ -21321,23 +21289,16 @@ const ApplePayButton = _ref => {
|
|
|
21321
21289
|
// // No updates or errors are needed, pass an empty object.
|
|
21322
21290
|
// const newTotal = {
|
|
21323
21291
|
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21292
|
+
// type: "final",
|
|
21324
21293
|
// amount: updatedPrice / 100
|
|
21325
21294
|
// };
|
|
21326
21295
|
|
|
21327
21296
|
// const newLineItems = [
|
|
21328
|
-
//
|
|
21329
|
-
//
|
|
21330
|
-
//
|
|
21331
|
-
//
|
|
21332
|
-
//
|
|
21333
|
-
// recurringPaymentStartDate: new Date().toISOString(),
|
|
21334
|
-
// recurringPaymentIntervalUnit: plan?.interval,
|
|
21335
|
-
// recurringPaymentIntervalCount: plan?.interval_count
|
|
21336
|
-
// }
|
|
21337
|
-
// : {
|
|
21338
|
-
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21339
|
-
// amount: updatedPrice / 100
|
|
21340
|
-
// }
|
|
21297
|
+
// {
|
|
21298
|
+
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21299
|
+
// type: "final",
|
|
21300
|
+
// amount: updatedPrice / 100
|
|
21301
|
+
// }
|
|
21341
21302
|
// ];
|
|
21342
21303
|
|
|
21343
21304
|
// session.completeShippingMethodSelection(newTotal, newLineItems);
|
package/dist/index.esm.js
CHANGED
|
@@ -21150,11 +21150,10 @@ const ApplePayButton = _ref => {
|
|
|
21150
21150
|
invoice
|
|
21151
21151
|
} = usePelcro();
|
|
21152
21152
|
const {
|
|
21153
|
-
payPageId,
|
|
21154
|
-
reportGroup,
|
|
21153
|
+
pay_page_id: payPageId,
|
|
21154
|
+
report_group: reportGroup,
|
|
21155
21155
|
apple_pay_merchant_id: ApplePayMerchantId,
|
|
21156
|
-
apple_pay_enabled: ApplePayEnabled
|
|
21157
|
-
apple_pay_billing_agreement: ApplePayBillingAgreement
|
|
21156
|
+
apple_pay_enabled: ApplePayEnabled
|
|
21158
21157
|
} = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
|
|
21159
21158
|
const updatedPrice = (_ref2 = (_ref3 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : props === null || props === void 0 ? void 0 : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref3 !== void 0 ? _ref3 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining;
|
|
21160
21159
|
useEffect(() => {
|
|
@@ -21194,35 +21193,9 @@ const ApplePayButton = _ref => {
|
|
|
21194
21193
|
supportedNetworks: ["visa", "masterCard", "amex", "discover"],
|
|
21195
21194
|
total: {
|
|
21196
21195
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21196
|
+
type: "final",
|
|
21197
21197
|
amount: updatedPrice / 100
|
|
21198
|
-
}
|
|
21199
|
-
lineItems: [plan !== null && plan !== void 0 && plan.auto_renew ? {
|
|
21200
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21201
|
-
amount: updatedPrice / 100,
|
|
21202
|
-
paymentTiming: "recurring",
|
|
21203
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21204
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21205
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21206
|
-
} : {
|
|
21207
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21208
|
-
amount: updatedPrice / 100
|
|
21209
|
-
}],
|
|
21210
|
-
...((plan === null || plan === void 0 ? void 0 : plan.auto_renew) && {
|
|
21211
|
-
recurringPaymentRequest: {
|
|
21212
|
-
paymentDescription: "A description of the recurring payment to display to the user in the payment sheet.",
|
|
21213
|
-
regularBilling: {
|
|
21214
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21215
|
-
amount: updatedPrice / 100,
|
|
21216
|
-
paymentTiming: "recurring",
|
|
21217
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21218
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21219
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21220
|
-
},
|
|
21221
|
-
billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
|
|
21222
|
-
managementURL: "https://applepaydemo.apple.com",
|
|
21223
|
-
tokenNotificationURL: "https://applepaydemo.apple.com"
|
|
21224
|
-
}
|
|
21225
|
-
})
|
|
21198
|
+
}
|
|
21226
21199
|
};
|
|
21227
21200
|
console.log(ApplePayPaymentRequest);
|
|
21228
21201
|
// Create ApplePaySession
|
|
@@ -21268,17 +21241,12 @@ const ApplePayButton = _ref => {
|
|
|
21268
21241
|
// No updates or errors are needed, pass an empty object.
|
|
21269
21242
|
const newTotal = {
|
|
21270
21243
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21244
|
+
type: "final",
|
|
21271
21245
|
amount: updatedPrice / 100
|
|
21272
21246
|
};
|
|
21273
|
-
const newLineItems = [
|
|
21274
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21275
|
-
amount: updatedPrice / 100,
|
|
21276
|
-
paymentTiming: "recurring",
|
|
21277
|
-
recurringPaymentStartDate: new Date().toISOString(),
|
|
21278
|
-
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
21279
|
-
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
21280
|
-
} : {
|
|
21247
|
+
const newLineItems = [{
|
|
21281
21248
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
21249
|
+
type: "final",
|
|
21282
21250
|
amount: updatedPrice / 100
|
|
21283
21251
|
}];
|
|
21284
21252
|
session.completePaymentMethodSelection(newTotal, newLineItems);
|
|
@@ -21291,23 +21259,16 @@ const ApplePayButton = _ref => {
|
|
|
21291
21259
|
// // No updates or errors are needed, pass an empty object.
|
|
21292
21260
|
// const newTotal = {
|
|
21293
21261
|
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21262
|
+
// type: "final",
|
|
21294
21263
|
// amount: updatedPrice / 100
|
|
21295
21264
|
// };
|
|
21296
21265
|
|
|
21297
21266
|
// const newLineItems = [
|
|
21298
|
-
//
|
|
21299
|
-
//
|
|
21300
|
-
//
|
|
21301
|
-
//
|
|
21302
|
-
//
|
|
21303
|
-
// recurringPaymentStartDate: new Date().toISOString(),
|
|
21304
|
-
// recurringPaymentIntervalUnit: plan?.interval,
|
|
21305
|
-
// recurringPaymentIntervalCount: plan?.interval_count
|
|
21306
|
-
// }
|
|
21307
|
-
// : {
|
|
21308
|
-
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21309
|
-
// amount: updatedPrice / 100
|
|
21310
|
-
// }
|
|
21267
|
+
// {
|
|
21268
|
+
// label: plan?.nickname || `invoice #${invoice.id}`,
|
|
21269
|
+
// type: "final",
|
|
21270
|
+
// amount: updatedPrice / 100
|
|
21271
|
+
// }
|
|
21311
21272
|
// ];
|
|
21312
21273
|
|
|
21313
21274
|
// session.completeShippingMethodSelection(newTotal, newLineItems);
|