@payment-kit-js/vanilla 0.5.16 → 0.5.17

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * PaymentKit.js v0.5.16
2
+ * PaymentKit.js v0.5.17
3
3
  * https://paymentkit.com
4
4
  *
5
5
  * @license MIT
@@ -42,7 +42,7 @@ var PaymentKit = (() => {
42
42
  });
43
43
 
44
44
  // package.json
45
- var version = "0.5.16";
45
+ var version = "0.5.17";
46
46
 
47
47
  // src/analytics/mock-adapter.ts
48
48
  var MockAnalyticsAdapter = class {
@@ -7527,17 +7527,14 @@ var PaymentKit = (() => {
7527
7527
  function getMockScenarioStr(mockScenario) {
7528
7528
  return mockScenario && mockScenario !== "none" /* None */ ? mockScenario : void 0;
7529
7529
  }
7530
- async function callStripeStartEndpoint(apiBaseUrl, secureToken, options, mockScenarioStr, checkoutRequestId) {
7530
+ async function callStripeStartEndpoint(apiBaseUrl, secureToken, options, checkoutRequestId) {
7531
7531
  return apiCall(
7532
7532
  `${apiBaseUrl}/api/checkout/${secureToken}/apple-pay/start`,
7533
7533
  {
7534
7534
  method: "POST",
7535
7535
  headers: { "Content-Type": "application/json" },
7536
7536
  body: JSON.stringify({
7537
- processor_id: options.processorId,
7538
- customer_info: options.customerInfo,
7539
- fraud_metadata: collectFraudMetadata(),
7540
- mock_scenario: mockScenarioStr
7537
+ processor_id: options.processorId
7541
7538
  })
7542
7539
  },
7543
7540
  checkoutRequestId
@@ -7550,13 +7547,16 @@ var PaymentKit = (() => {
7550
7547
  }
7551
7548
  return { adapter };
7552
7549
  }
7553
- async function callStripeConfirmEndpoint(apiBaseUrl, secureToken, paymentMethodId, mockScenarioStr, checkoutRequestId, payerEmail) {
7550
+ async function callStripeConfirmEndpoint(apiBaseUrl, secureToken, options, paymentMethodId, mockScenarioStr, checkoutRequestId, payerEmail) {
7554
7551
  const result = await apiCall(
7555
7552
  `${apiBaseUrl}/api/checkout/${secureToken}/apple-pay/confirm`,
7556
7553
  {
7557
7554
  method: "POST",
7558
7555
  headers: { "Content-Type": "application/json" },
7559
7556
  body: JSON.stringify({
7557
+ processor_id: options.processorId,
7558
+ customer_info: options.customerInfo,
7559
+ fraud_metadata: collectFraudMetadata(),
7560
7560
  payment_method_id: paymentMethodId,
7561
7561
  payer_email: payerEmail,
7562
7562
  mock_scenario: mockScenarioStr
@@ -7647,7 +7647,6 @@ var PaymentKit = (() => {
7647
7647
  apiBaseUrl,
7648
7648
  secureToken,
7649
7649
  options,
7650
- mockScenarioStr,
7651
7650
  checkoutRequestId
7652
7651
  );
7653
7652
  if (startResult.error || !startResult.data) {
@@ -7952,6 +7951,7 @@ var PaymentKit = (() => {
7952
7951
  const confirmResult2 = await callStripeConfirmEndpoint(
7953
7952
  apiBaseUrl,
7954
7953
  secureToken,
7954
+ applePayOptions,
7955
7955
  paymentMethodId2,
7956
7956
  mockScenarioStr,
7957
7957
  preparedStripeState.checkoutRequestId,
@@ -7985,7 +7985,6 @@ var PaymentKit = (() => {
7985
7985
  apiBaseUrl,
7986
7986
  secureToken,
7987
7987
  applePayOptions,
7988
- mockScenarioStr,
7989
7988
  checkoutRequestId
7990
7989
  );
7991
7990
  if (startResult.error || !startResult.data) {
@@ -8023,6 +8022,7 @@ var PaymentKit = (() => {
8023
8022
  const confirmResult = await callStripeConfirmEndpoint(
8024
8023
  apiBaseUrl,
8025
8024
  secureToken,
8025
+ applePayOptions,
8026
8026
  paymentMethodId,
8027
8027
  mockScenarioStr,
8028
8028
  checkoutRequestId,