@fat-zebra/sdk 1.5.7 → 1.5.8-beta.1

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.
@@ -17,6 +17,7 @@ export declare class ApplePay {
17
17
  private username;
18
18
  private environment;
19
19
  private paymentIntent;
20
+ private react_sdk?;
20
21
  constructor(config: {
21
22
  environment: Environment;
22
23
  paymentIntent: PaymentIntent;
@@ -24,9 +24,10 @@ export class ApplePay {
24
24
  this.username = config.username;
25
25
  }
26
26
  load(config) {
27
- var _a, _b;
27
+ var _a, _b, _c;
28
28
  this.domain_name = (_b = (_a = config === null || config === void 0 ? void 0 : config.options) === null || _a === void 0 ? void 0 : _a.domain_name) !== null && _b !== void 0 ? _b : window.location.hostname;
29
29
  this.iframe = document.createElement('iframe');
30
+ this.react_sdk = (_c = config.options.react_sdk) !== null && _c !== void 0 ? _c : false;
30
31
  document.getElementById(config.containerId).appendChild(this.iframe);
31
32
  const applePayUrl = this.getPayNowUrl(config.options);
32
33
  this.iframe.setAttribute("src", applePayUrl);
@@ -70,6 +71,9 @@ export class ApplePay {
70
71
  if (options === null || options === void 0 ? void 0 : options.apple_button_locale) {
71
72
  query.append('apple_button_locale', options.apple_button_locale.toString());
72
73
  }
74
+ if (options === null || options === void 0 ? void 0 : options.react_sdk) {
75
+ query.append('react_sdk', 'true');
76
+ }
73
77
  query.append('domain_name', this.domain_name);
74
78
  return `${base}?${query.toString()}`;
75
79
  }
@@ -127,7 +131,7 @@ export class ApplePay {
127
131
  });
128
132
  this.applePaySession.onpaymentauthorized = (event) => __awaiter(this, void 0, void 0, function* () {
129
133
  try {
130
- const result = yield payNow.authorizePayment(Object.assign(Object.assign({}, payNowPaymentAttributes), { merchant: this.username, token: event.payment.token, domain_name: this.domain_name }), `${this.fzPayNowDomain}${purchaseTokenPath}`);
134
+ const result = yield payNow.authorizePayment(Object.assign(Object.assign({}, payNowPaymentAttributes), { merchant: this.username, token: event.payment.token, domain_name: this.domain_name }), `${this.fzPayNowDomain}${purchaseTokenPath}?react_sdk=${this.react_sdk}`);
131
135
  this.applePaySession.completePayment(window.ApplePaySession.STATUS_SUCCESS);
132
136
  const payload = {
133
137
  message: 'Payment successful.',