@economist/web-apple-pay 0.1.3-beta.11 → 0.1.3-beta.12

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.js CHANGED
@@ -1169,7 +1169,6 @@ var validateAppleMerchant = (data) => {
1169
1169
  });
1170
1170
  };
1171
1171
  var performPurchase = (data) => {
1172
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
1173
1172
  return apiFetch("/v1/wallet/purchase", {
1174
1173
  method: "POST",
1175
1174
  body: JSON.stringify(data),
@@ -1572,7 +1571,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
1572
1571
  sessionData,
1573
1572
  config.supportedBillingCountries
1574
1573
  );
1575
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
1576
1574
  const result = await performPurchase({
1577
1575
  applePayToken: event.payment.token,
1578
1576
  skuId: config.skuId,
@@ -2142,12 +2140,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2142
2140
  if (this.#sessionData?.loggedIn) {
2143
2141
  modal.dataset.loggedIn = "true";
2144
2142
  }
2145
- const { skuId, country } = { skuId: this.#offer.sku_id, country: this.#country };
2143
+ const skuId = this.#offer.sku_id;
2144
+ const country = this.#country;
2146
2145
  modal.onConfirm = (recaptchaTokens) => {
2147
2146
  this.#initiateApplePay(skuId, country, recaptchaTokens);
2147
+ this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2148
2148
  };
2149
- modal.open(this.#recaptchaTokensPromise ?? void 0);
2150
- this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2149
+ modal.open(this.#recaptchaTokensPromise);
2151
2150
  }
2152
2151
  async #fetchSession() {
2153
2152
  try {
@@ -1164,7 +1164,6 @@ var validateAppleMerchant = (data) => {
1164
1164
  });
1165
1165
  };
1166
1166
  var performPurchase = (data) => {
1167
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
1168
1167
  return apiFetch("/v1/wallet/purchase", {
1169
1168
  method: "POST",
1170
1169
  body: JSON.stringify(data),
@@ -1567,7 +1566,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
1567
1566
  sessionData,
1568
1567
  config.supportedBillingCountries
1569
1568
  );
1570
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
1571
1569
  const result = await performPurchase({
1572
1570
  applePayToken: event.payment.token,
1573
1571
  skuId: config.skuId,
@@ -2137,12 +2135,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2137
2135
  if (this.#sessionData?.loggedIn) {
2138
2136
  modal.dataset.loggedIn = "true";
2139
2137
  }
2140
- const { skuId, country } = { skuId: this.#offer.sku_id, country: this.#country };
2138
+ const skuId = this.#offer.sku_id;
2139
+ const country = this.#country;
2141
2140
  modal.onConfirm = (recaptchaTokens) => {
2142
2141
  this.#initiateApplePay(skuId, country, recaptchaTokens);
2142
+ this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2143
2143
  };
2144
- modal.open(this.#recaptchaTokensPromise ?? void 0);
2145
- this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2144
+ modal.open(this.#recaptchaTokensPromise);
2146
2145
  }
2147
2146
  async #fetchSession() {
2148
2147
  try {
@@ -1172,7 +1172,6 @@ var validateAppleMerchant = (data) => {
1172
1172
  });
1173
1173
  };
1174
1174
  var performPurchase = (data) => {
1175
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
1176
1175
  return apiFetch("/v1/wallet/purchase", {
1177
1176
  method: "POST",
1178
1177
  body: JSON.stringify(data),
@@ -1575,7 +1574,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
1575
1574
  sessionData,
1576
1575
  config.supportedBillingCountries
1577
1576
  );
1578
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
1579
1577
  const result = await performPurchase({
1580
1578
  applePayToken: event.payment.token,
1581
1579
  skuId: config.skuId,
@@ -2145,12 +2143,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2145
2143
  if (this.#sessionData?.loggedIn) {
2146
2144
  modal.dataset.loggedIn = "true";
2147
2145
  }
2148
- const { skuId, country } = { skuId: this.#offer.sku_id, country: this.#country };
2146
+ const skuId = this.#offer.sku_id;
2147
+ const country = this.#country;
2149
2148
  modal.onConfirm = (recaptchaTokens) => {
2150
2149
  this.#initiateApplePay(skuId, country, recaptchaTokens);
2150
+ this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2151
2151
  };
2152
- modal.open(this.#recaptchaTokensPromise ?? void 0);
2153
- this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2152
+ modal.open(this.#recaptchaTokensPromise);
2154
2153
  }
2155
2154
  async #fetchSession() {
2156
2155
  try {
@@ -21,7 +21,7 @@ export declare class ApplePayModal extends HTMLElement {
21
21
  get country(): string;
22
22
  set country(value: string);
23
23
  connectedCallback(): void;
24
- open(recaptchaTokensPromise?: Promise<RecaptchaTokens>): void;
24
+ open(recaptchaTokensPromise?: Promise<RecaptchaTokens> | null): void;
25
25
  close(): void;
26
26
  }
27
27
  export {};
@@ -1164,7 +1164,6 @@ var validateAppleMerchant = (data) => {
1164
1164
  });
1165
1165
  };
1166
1166
  var performPurchase = (data) => {
1167
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
1168
1167
  return apiFetch("/v1/wallet/purchase", {
1169
1168
  method: "POST",
1170
1169
  body: JSON.stringify(data),
@@ -1567,7 +1566,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
1567
1566
  sessionData,
1568
1567
  config.supportedBillingCountries
1569
1568
  );
1570
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
1571
1569
  const result = await performPurchase({
1572
1570
  applePayToken: event.payment.token,
1573
1571
  skuId: config.skuId,
@@ -2137,12 +2135,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2137
2135
  if (this.#sessionData?.loggedIn) {
2138
2136
  modal.dataset.loggedIn = "true";
2139
2137
  }
2140
- const { skuId, country } = { skuId: this.#offer.sku_id, country: this.#country };
2138
+ const skuId = this.#offer.sku_id;
2139
+ const country = this.#country;
2141
2140
  modal.onConfirm = (recaptchaTokens) => {
2142
2141
  this.#initiateApplePay(skuId, country, recaptchaTokens);
2142
+ this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2143
2143
  };
2144
- modal.open(this.#recaptchaTokensPromise ?? void 0);
2145
- this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2144
+ modal.open(this.#recaptchaTokensPromise);
2146
2145
  }
2147
2146
  async #fetchSession() {
2148
2147
  try {
@@ -69,7 +69,6 @@ var validateAppleMerchant = (data) => {
69
69
  });
70
70
  };
71
71
  var performPurchase = (data) => {
72
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
73
72
  return apiFetch("/v1/wallet/purchase", {
74
73
  method: "POST",
75
74
  body: JSON.stringify(data),
@@ -55,7 +55,6 @@ var apiFetch = async (path, options = {}) => {
55
55
  return response.json();
56
56
  };
57
57
  var performPurchase = (data) => {
58
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
59
58
  return apiFetch("/v1/wallet/purchase", {
60
59
  method: "POST",
61
60
  body: JSON.stringify(data),
@@ -336,7 +335,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
336
335
  sessionData,
337
336
  config.supportedBillingCountries
338
337
  );
339
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
340
338
  const result = await performPurchase({
341
339
  applePayToken: event.payment.token,
342
340
  skuId: config.skuId,
package/dist/src/index.js CHANGED
@@ -1169,7 +1169,6 @@ var validateAppleMerchant = (data) => {
1169
1169
  });
1170
1170
  };
1171
1171
  var performPurchase = (data) => {
1172
- console.log("[web-apple-pay] performPurchase request", JSON.stringify(data, null, 2));
1173
1172
  return apiFetch("/v1/wallet/purchase", {
1174
1173
  method: "POST",
1175
1174
  body: JSON.stringify(data),
@@ -1572,7 +1571,6 @@ async function handlePaymentAuthorized(event, session, sessionData, config) {
1572
1571
  sessionData,
1573
1572
  config.supportedBillingCountries
1574
1573
  );
1575
- console.log("[web-apple-pay] performPurchase currency", { skuId, currency: config.currency });
1576
1574
  const result = await performPurchase({
1577
1575
  applePayToken: event.payment.token,
1578
1576
  skuId: config.skuId,
@@ -2142,12 +2140,13 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2142
2140
  if (this.#sessionData?.loggedIn) {
2143
2141
  modal.dataset.loggedIn = "true";
2144
2142
  }
2145
- const { skuId, country } = { skuId: this.#offer.sku_id, country: this.#country };
2143
+ const skuId = this.#offer.sku_id;
2144
+ const country = this.#country;
2146
2145
  modal.onConfirm = (recaptchaTokens) => {
2147
2146
  this.#initiateApplePay(skuId, country, recaptchaTokens);
2147
+ this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2148
2148
  };
2149
- modal.open(this.#recaptchaTokensPromise ?? void 0);
2150
- this.#recaptchaTokensPromise = getPurchaseRecaptchaTokens();
2149
+ modal.open(this.#recaptchaTokensPromise);
2151
2150
  }
2152
2151
  async #fetchSession() {
2153
2152
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@economist/web-apple-pay",
3
3
  "description": "Web component package for Apple Pay checkout UI",
4
- "version": "0.1.3-beta.11",
4
+ "version": "0.1.3-beta.12",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",