@pelcro/react-pelcro-js 3.26.0-sandbox.26 → 3.26.0-sandbox.27

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 CHANGED
@@ -20321,11 +20321,10 @@ const ApplePayButton = _ref => {
20321
20321
  invoice
20322
20322
  } = usePelcro();
20323
20323
  const {
20324
- payPageId,
20325
- reportGroup,
20324
+ pay_page_id: payPageId,
20325
+ report_group: reportGroup,
20326
20326
  apple_pay_merchant_id: ApplePayMerchantId,
20327
- apple_pay_enabled: ApplePayEnabled,
20328
- apple_pay_billing_agreement: ApplePayBillingAgreement
20327
+ apple_pay_enabled: ApplePayEnabled
20329
20328
  } = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
20330
20329
  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;
20331
20330
  React.useEffect(() => {
@@ -20365,35 +20364,9 @@ const ApplePayButton = _ref => {
20365
20364
  supportedNetworks: ["visa", "masterCard", "amex", "discover"],
20366
20365
  total: {
20367
20366
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20367
+ type: "final",
20368
20368
  amount: updatedPrice / 100
20369
- },
20370
- lineItems: [plan !== null && plan !== void 0 && plan.auto_renew ? {
20371
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20372
- amount: updatedPrice / 100,
20373
- paymentTiming: "recurring",
20374
- recurringPaymentStartDate: new Date().toISOString(),
20375
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20376
- 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
20377
- } : {
20378
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20379
- amount: updatedPrice / 100
20380
- }],
20381
- ...((plan === null || plan === void 0 ? void 0 : plan.auto_renew) && {
20382
- recurringPaymentRequest: {
20383
- paymentDescription: "A description of the recurring payment to display to the user in the payment sheet.",
20384
- regularBilling: {
20385
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20386
- amount: updatedPrice / 100,
20387
- paymentTiming: "recurring",
20388
- recurringPaymentStartDate: new Date().toISOString(),
20389
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20390
- 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
20391
- },
20392
- billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
20393
- managementURL: "https://applepaydemo.apple.com",
20394
- tokenNotificationURL: "https://applepaydemo.apple.com"
20395
- }
20396
- })
20369
+ }
20397
20370
  };
20398
20371
  console.log(ApplePayPaymentRequest);
20399
20372
  // Create ApplePaySession
@@ -20439,17 +20412,12 @@ const ApplePayButton = _ref => {
20439
20412
  // No updates or errors are needed, pass an empty object.
20440
20413
  const newTotal = {
20441
20414
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20415
+ type: "final",
20442
20416
  amount: updatedPrice / 100
20443
20417
  };
20444
- const newLineItems = [plan !== null && plan !== void 0 && plan.auto_renew ? {
20445
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20446
- amount: updatedPrice / 100,
20447
- paymentTiming: "recurring",
20448
- recurringPaymentStartDate: new Date().toISOString(),
20449
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20450
- 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
20451
- } : {
20418
+ const newLineItems = [{
20452
20419
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20420
+ type: "final",
20453
20421
  amount: updatedPrice / 100
20454
20422
  }];
20455
20423
  session.completePaymentMethodSelection(newTotal, newLineItems);
@@ -20462,23 +20430,16 @@ const ApplePayButton = _ref => {
20462
20430
  // // No updates or errors are needed, pass an empty object.
20463
20431
  // const newTotal = {
20464
20432
  // label: plan?.nickname || `invoice #${invoice.id}`,
20433
+ // type: "final",
20465
20434
  // amount: updatedPrice / 100
20466
20435
  // };
20467
20436
 
20468
20437
  // const newLineItems = [
20469
- // plan?.auto_renew
20470
- // ? {
20471
- // label: plan?.nickname || `invoice #${invoice.id}`,
20472
- // amount: updatedPrice / 100,
20473
- // paymentTiming: "recurring",
20474
- // recurringPaymentStartDate: new Date().toISOString(),
20475
- // recurringPaymentIntervalUnit: plan?.interval,
20476
- // recurringPaymentIntervalCount: plan?.interval_count
20477
- // }
20478
- // : {
20479
- // label: plan?.nickname || `invoice #${invoice.id}`,
20480
- // amount: updatedPrice / 100
20481
- // }
20438
+ // {
20439
+ // label: plan?.nickname || `invoice #${invoice.id}`,
20440
+ // type: "final",
20441
+ // amount: updatedPrice / 100
20442
+ // }
20482
20443
  // ];
20483
20444
 
20484
20445
  // session.completeShippingMethodSelection(newTotal, newLineItems);
package/dist/index.esm.js CHANGED
@@ -20291,11 +20291,10 @@ const ApplePayButton = _ref => {
20291
20291
  invoice
20292
20292
  } = usePelcro();
20293
20293
  const {
20294
- payPageId,
20295
- reportGroup,
20294
+ pay_page_id: payPageId,
20295
+ report_group: reportGroup,
20296
20296
  apple_pay_merchant_id: ApplePayMerchantId,
20297
- apple_pay_enabled: ApplePayEnabled,
20298
- apple_pay_billing_agreement: ApplePayBillingAgreement
20297
+ apple_pay_enabled: ApplePayEnabled
20299
20298
  } = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
20300
20299
  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;
20301
20300
  useEffect(() => {
@@ -20335,35 +20334,9 @@ const ApplePayButton = _ref => {
20335
20334
  supportedNetworks: ["visa", "masterCard", "amex", "discover"],
20336
20335
  total: {
20337
20336
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20337
+ type: "final",
20338
20338
  amount: updatedPrice / 100
20339
- },
20340
- lineItems: [plan !== null && plan !== void 0 && plan.auto_renew ? {
20341
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20342
- amount: updatedPrice / 100,
20343
- paymentTiming: "recurring",
20344
- recurringPaymentStartDate: new Date().toISOString(),
20345
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20346
- 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
20347
- } : {
20348
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20349
- amount: updatedPrice / 100
20350
- }],
20351
- ...((plan === null || plan === void 0 ? void 0 : plan.auto_renew) && {
20352
- recurringPaymentRequest: {
20353
- paymentDescription: "A description of the recurring payment to display to the user in the payment sheet.",
20354
- regularBilling: {
20355
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20356
- amount: updatedPrice / 100,
20357
- paymentTiming: "recurring",
20358
- recurringPaymentStartDate: new Date().toISOString(),
20359
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20360
- 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
20361
- },
20362
- billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
20363
- managementURL: "https://applepaydemo.apple.com",
20364
- tokenNotificationURL: "https://applepaydemo.apple.com"
20365
- }
20366
- })
20339
+ }
20367
20340
  };
20368
20341
  console.log(ApplePayPaymentRequest);
20369
20342
  // Create ApplePaySession
@@ -20409,17 +20382,12 @@ const ApplePayButton = _ref => {
20409
20382
  // No updates or errors are needed, pass an empty object.
20410
20383
  const newTotal = {
20411
20384
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20385
+ type: "final",
20412
20386
  amount: updatedPrice / 100
20413
20387
  };
20414
- const newLineItems = [plan !== null && plan !== void 0 && plan.auto_renew ? {
20415
- label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20416
- amount: updatedPrice / 100,
20417
- paymentTiming: "recurring",
20418
- recurringPaymentStartDate: new Date().toISOString(),
20419
- recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
20420
- 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
20421
- } : {
20388
+ const newLineItems = [{
20422
20389
  label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
20390
+ type: "final",
20423
20391
  amount: updatedPrice / 100
20424
20392
  }];
20425
20393
  session.completePaymentMethodSelection(newTotal, newLineItems);
@@ -20432,23 +20400,16 @@ const ApplePayButton = _ref => {
20432
20400
  // // No updates or errors are needed, pass an empty object.
20433
20401
  // const newTotal = {
20434
20402
  // label: plan?.nickname || `invoice #${invoice.id}`,
20403
+ // type: "final",
20435
20404
  // amount: updatedPrice / 100
20436
20405
  // };
20437
20406
 
20438
20407
  // const newLineItems = [
20439
- // plan?.auto_renew
20440
- // ? {
20441
- // label: plan?.nickname || `invoice #${invoice.id}`,
20442
- // amount: updatedPrice / 100,
20443
- // paymentTiming: "recurring",
20444
- // recurringPaymentStartDate: new Date().toISOString(),
20445
- // recurringPaymentIntervalUnit: plan?.interval,
20446
- // recurringPaymentIntervalCount: plan?.interval_count
20447
- // }
20448
- // : {
20449
- // label: plan?.nickname || `invoice #${invoice.id}`,
20450
- // amount: updatedPrice / 100
20451
- // }
20408
+ // {
20409
+ // label: plan?.nickname || `invoice #${invoice.id}`,
20410
+ // type: "final",
20411
+ // amount: updatedPrice / 100
20412
+ // }
20452
20413
  // ];
20453
20414
 
20454
20415
  // session.completeShippingMethodSelection(newTotal, newLineItems);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.26.0-sandbox.26",
4
+ "version": "3.26.0-sandbox.27",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",