@lightspeed/online-payments-sdk 1.6.1 → 1.6.3

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/README.md CHANGED
@@ -55,6 +55,7 @@ import {THEME_COLORS} from '@lightspeed/online-payments-sdk';
55
55
  ## Documentation
56
56
 
57
57
  - Datadog logging reference: `packages/lsp-online-payments-sdk/docs/DATADOG_LOGGING.md`
58
+ - Sandbox releases (testing unreleased builds in a real app): `packages/lsp-online-payments-sdk/docs/sandbox-releases.md`
58
59
 
59
60
  ## Development
60
61
 
@@ -90,3 +91,11 @@ Publishing is handled by CircleCI (not manual local publish).
90
91
  - A human must approve before the `release` job runs `npm publish`.
91
92
 
92
93
  In practice: bump `version` in `packages/lsp-online-payments-sdk/package.json`, merge to `main`, then approve the release hold in CircleCI.
94
+
95
+ ### Sandbox releases
96
+
97
+ To test unreleased SDK changes inside a real app without touching the production
98
+ package on public npm, publish a **sandbox** build to GitHub Packages: push a
99
+ `sandbox/*` branch and approve the `hold_sandbox` step in CircleCI. Consuming an
100
+ app requires no `import` changes — just an `.npmrc` scope + a `package.json`
101
+ alias. See `docs/sandbox-releases.md` for the full publish and consume steps.
@@ -25,7 +25,7 @@ exports.ACH_TERMS_TEXT = {
25
25
  */
26
26
  EXPANDED_TERMS_PARAGRAPHS: [
27
27
  'By providing your bank account details and confirming this payment, you authorize the merchant to debit your account for the amount shown.',
28
- 'If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it.',
28
+ 'If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it. For returns due to insufficient funds or uncollected funds, the merchant may retry the debit up to two additional times. If you save your bank account, you authorize Stripe and Lightspeed to access your account status and balance information, where available, before submitting current or future ACH payments. A balance check does not guarantee that an ACH payment will be completed.',
29
29
  'You also authorize the merchant to credit your account as necessary to correct any erroneous debits.',
30
30
  'You may revoke authorization at any time by contacting the merchant, allowing up to thirty (30) days for processing.\nYou confirm that you are an authorized signer on the account and that sufficient funds will be available for each payment.\nACH payments may take up to five (5) business days to complete, and you may be responsible for fees if a payment is returned.',
31
31
  ],
@@ -43,22 +43,28 @@ var shared_1 = require("../shared");
43
43
  */
44
44
  function mountPaymentWidget(mountElement, session, eventBroadcaster, defaultValues, theme) {
45
45
  return __awaiter(this, void 0, void 0, function () {
46
- var _a, stripe, elements, addressOptions, _b, addressElement, addressContainer, productMetadata, isPartnerProduct, showCardMandate, paymentOptions, _c, paymentElement, paymentContainer, customTermsContainer;
47
- return __generator(this, function (_d) {
48
- switch (_d.label) {
46
+ var _a, stripe, elements, productMetadata, isPartnerProduct, addressElement, addressContainer, addressOptions, created, showCardMandate, paymentOptions, _b, paymentElement, paymentContainer, customTermsContainer;
47
+ return __generator(this, function (_c) {
48
+ switch (_c.label) {
49
49
  case 0: return [4 /*yield*/, (0, shared_1.initStripe)(session.context, theme)];
50
50
  case 1:
51
- _a = _d.sent(), stripe = _a.stripe, elements = _a.elements;
52
- addressOptions = (0, shared_1.createAddressElementOptions)(defaultValues);
53
- _b = (0, shared_1.createAddressElement)(elements, addressOptions, mountElement), addressElement = _b.element, addressContainer = _b.container;
51
+ _a = _c.sent(), stripe = _a.stripe, elements = _a.elements;
54
52
  productMetadata = session.metadata.product;
55
53
  isPartnerProduct = typeof productMetadata === 'string' &&
56
54
  productMetadata.startsWith('partner:');
55
+ addressElement = null;
56
+ addressContainer = null;
57
+ if (!isPartnerProduct) {
58
+ addressOptions = (0, shared_1.createAddressElementOptions)(defaultValues);
59
+ created = (0, shared_1.createAddressElement)(elements, addressOptions, mountElement);
60
+ addressElement = created.element;
61
+ addressContainer = created.container;
62
+ }
57
63
  showCardMandate = session.metadata.sessionType === 'payment-with-save' &&
58
64
  !!session.context.businessName &&
59
65
  isPartnerProduct;
60
- paymentOptions = (0, shared_1.createPaymentElementOptions)(defaultValues, theme, true, session.context.businessName, showCardMandate);
61
- _c = (0, shared_1.createPaymentElement)(elements, paymentOptions, mountElement, eventBroadcaster), paymentElement = _c.element, paymentContainer = _c.container, customTermsContainer = _c.customTermsContainer;
66
+ paymentOptions = (0, shared_1.createPaymentElementOptions)(defaultValues, theme, !!addressElement, session.context.businessName, showCardMandate);
67
+ _b = (0, shared_1.createPaymentElement)(elements, paymentOptions, mountElement, eventBroadcaster), paymentElement = _b.element, paymentContainer = _b.container, customTermsContainer = _b.customTermsContainer;
62
68
  // Setup change handler that emits Complete only when both elements are complete
63
69
  (0, shared_1.setupChangeEventHandler)(paymentElement, eventBroadcaster, addressElement);
64
70
  return [2 /*return*/, {
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  // This file is auto-generated during the build process
5
5
  // DO NOT EDIT MANUALLY - Version is extracted from package.json
6
- exports.SDK_VERSION = '1.6.1';
6
+ exports.SDK_VERSION = '1.6.3';
@@ -20,7 +20,7 @@ export declare const ACH_TERMS_TEXT: {
20
20
  * Each entry is a separate paragraph rendered when the user expands
21
21
  * "these terms". Kept as plain text — HTML structure is built in code.
22
22
  */
23
- readonly EXPANDED_TERMS_PARAGRAPHS: readonly ["By providing your bank account details and confirming this payment, you authorize the merchant to debit your account for the amount shown.", "If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it.", "You also authorize the merchant to credit your account as necessary to correct any erroneous debits.", "You may revoke authorization at any time by contacting the merchant, allowing up to thirty (30) days for processing.\nYou confirm that you are an authorized signer on the account and that sufficient funds will be available for each payment.\nACH payments may take up to five (5) business days to complete, and you may be responsible for fees if a payment is returned."];
23
+ readonly EXPANDED_TERMS_PARAGRAPHS: readonly ["By providing your bank account details and confirming this payment, you authorize the merchant to debit your account for the amount shown.", "If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it. For returns due to insufficient funds or uncollected funds, the merchant may retry the debit up to two additional times. If you save your bank account, you authorize Stripe and Lightspeed to access your account status and balance information, where available, before submitting current or future ACH payments. A balance check does not guarantee that an ACH payment will be completed.", "You also authorize the merchant to credit your account as necessary to correct any erroneous debits.", "You may revoke authorization at any time by contacting the merchant, allowing up to thirty (30) days for processing.\nYou confirm that you are an authorized signer on the account and that sufficient funds will be available for each payment.\nACH payments may take up to five (5) business days to complete, and you may be responsible for fees if a payment is returned."];
24
24
  /**
25
25
  * Final paragraph containing a link to the Privacy Policy.
26
26
  * The link text and URL are defined separately so translators only
@@ -22,7 +22,7 @@ export var ACH_TERMS_TEXT = {
22
22
  */
23
23
  EXPANDED_TERMS_PARAGRAPHS: [
24
24
  'By providing your bank account details and confirming this payment, you authorize the merchant to debit your account for the amount shown.',
25
- 'If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it.',
25
+ 'If you choose to save your bank account for future payments, this authorization will also apply to any amounts now or hereafter due and payable, including amounts previously invoiced, accrued, outstanding, or otherwise payable, in addition to current, and future payment obligations owed for products or services provided by the merchant, until you cancel it. For returns due to insufficient funds or uncollected funds, the merchant may retry the debit up to two additional times. If you save your bank account, you authorize Stripe and Lightspeed to access your account status and balance information, where available, before submitting current or future ACH payments. A balance check does not guarantee that an ACH payment will be completed.',
26
26
  'You also authorize the merchant to credit your account as necessary to correct any erroneous debits.',
27
27
  'You may revoke authorization at any time by contacting the merchant, allowing up to thirty (30) days for processing.\nYou confirm that you are an authorized signer on the account and that sufficient funds will be available for each payment.\nACH payments may take up to five (5) business days to complete, and you may be responsible for fees if a payment is returned.',
28
28
  ],
@@ -40,22 +40,28 @@ import { initStripe, createPaymentElementOptions, createAddressElementOptions, c
40
40
  */
41
41
  export function mountPaymentWidget(mountElement, session, eventBroadcaster, defaultValues, theme) {
42
42
  return __awaiter(this, void 0, void 0, function () {
43
- var _a, stripe, elements, addressOptions, _b, addressElement, addressContainer, productMetadata, isPartnerProduct, showCardMandate, paymentOptions, _c, paymentElement, paymentContainer, customTermsContainer;
44
- return __generator(this, function (_d) {
45
- switch (_d.label) {
43
+ var _a, stripe, elements, productMetadata, isPartnerProduct, addressElement, addressContainer, addressOptions, created, showCardMandate, paymentOptions, _b, paymentElement, paymentContainer, customTermsContainer;
44
+ return __generator(this, function (_c) {
45
+ switch (_c.label) {
46
46
  case 0: return [4 /*yield*/, initStripe(session.context, theme)];
47
47
  case 1:
48
- _a = _d.sent(), stripe = _a.stripe, elements = _a.elements;
49
- addressOptions = createAddressElementOptions(defaultValues);
50
- _b = createAddressElement(elements, addressOptions, mountElement), addressElement = _b.element, addressContainer = _b.container;
48
+ _a = _c.sent(), stripe = _a.stripe, elements = _a.elements;
51
49
  productMetadata = session.metadata.product;
52
50
  isPartnerProduct = typeof productMetadata === 'string' &&
53
51
  productMetadata.startsWith('partner:');
52
+ addressElement = null;
53
+ addressContainer = null;
54
+ if (!isPartnerProduct) {
55
+ addressOptions = createAddressElementOptions(defaultValues);
56
+ created = createAddressElement(elements, addressOptions, mountElement);
57
+ addressElement = created.element;
58
+ addressContainer = created.container;
59
+ }
54
60
  showCardMandate = session.metadata.sessionType === 'payment-with-save' &&
55
61
  !!session.context.businessName &&
56
62
  isPartnerProduct;
57
- paymentOptions = createPaymentElementOptions(defaultValues, theme, true, session.context.businessName, showCardMandate);
58
- _c = createPaymentElement(elements, paymentOptions, mountElement, eventBroadcaster), paymentElement = _c.element, paymentContainer = _c.container, customTermsContainer = _c.customTermsContainer;
63
+ paymentOptions = createPaymentElementOptions(defaultValues, theme, !!addressElement, session.context.businessName, showCardMandate);
64
+ _b = createPaymentElement(elements, paymentOptions, mountElement, eventBroadcaster), paymentElement = _b.element, paymentContainer = _b.container, customTermsContainer = _b.customTermsContainer;
59
65
  // Setup change handler that emits Complete only when both elements are complete
60
66
  setupChangeEventHandler(paymentElement, eventBroadcaster, addressElement);
61
67
  return [2 /*return*/, {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.6.1";
1
+ export declare const SDK_VERSION = "1.6.3";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is auto-generated during the build process
2
2
  // DO NOT EDIT MANUALLY - Version is extracted from package.json
3
- export var SDK_VERSION = '1.6.1';
3
+ export var SDK_VERSION = '1.6.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightspeed/online-payments-sdk",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Process online-payments with Lightspeed Payments",
5
5
  "author": "Lightspeed Commerce Inc.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",