tf-checkout-react-native 2.0.0-beta.16 → 2.0.0-beta.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.
package/dist/index.js CHANGED
@@ -24679,11 +24679,14 @@ var nativeSheetIntentIdentity = (intent, intentId, reviewed) => {
24679
24679
  const currency = own("currency");
24680
24680
  return own("id") === intentId && Number.isSafeInteger(amount2) && amount2 === reviewed.amountMinor && typeof currency === "string" && /^[A-Za-z]{3}$/.test(currency) && currency.toUpperCase() === reviewed.currency;
24681
24681
  };
24682
- var nativeSheetCardMethods = (intent) => {
24683
- var _a2;
24682
+ var nativeSheetMethods = (intent) => {
24683
+ var _a2, _b;
24684
24684
  if (!intent || typeof intent !== "object") return false;
24685
24685
  const methods = (_a2 = Object.getOwnPropertyDescriptor(intent, "paymentMethodTypes")) == null ? void 0 : _a2.value;
24686
- return Array.isArray(methods) && methods.length === 1 && methods[0] === "card";
24686
+ if (!Array.isArray(methods)) return false;
24687
+ if (methods.length === 1) return methods[0] === "card";
24688
+ const currency = (_b = Object.getOwnPropertyDescriptor(intent, "currency")) == null ? void 0 : _b.value;
24689
+ return methods.length === 2 && methods.includes("card") && methods.includes("cashapp") && typeof currency === "string" && currency.toUpperCase() === "USD";
24687
24690
  };
24688
24691
  var createPaymentSheetConfirmation = (sdk, options) => {
24689
24692
  let active2 = false;
@@ -24709,7 +24712,7 @@ var createPaymentSheetConfirmation = (sdk, options) => {
24709
24712
  const requireAdmittedIntent = (result4) => {
24710
24713
  if (result4.error || !nativeSheetIntentIdentity(result4.paymentIntent, intentId, options.reviewed))
24711
24714
  throw paymentProviderError(NATIVE_SHEET_REVIEW_REQUIRED, "notStarted");
24712
- if (!nativeSheetCardMethods(result4.paymentIntent))
24715
+ if (!nativeSheetMethods(result4.paymentIntent))
24713
24716
  throw paymentProviderError(NATIVE_SHEET_CARD_FIELD_MESSAGE, "notStarted", {
24714
24717
  code: NATIVE_SHEET_CARD_FIELD_REQUIRED
24715
24718
  });
@@ -24746,7 +24749,7 @@ var createPaymentSheetConfirmation = (sdk, options) => {
24746
24749
  );
24747
24750
  assertAfterPresentation();
24748
24751
  const result3 = await sdk.retrievePaymentIntent(clientSecret);
24749
- if (result3.error || !nativeSheetIntentIdentity(result3.paymentIntent, intentId, options.reviewed) || !nativeSheetCardMethods(result3.paymentIntent))
24752
+ if (result3.error || !nativeSheetIntentIdentity(result3.paymentIntent, intentId, options.reviewed) || !nativeSheetMethods(result3.paymentIntent))
24750
24753
  throw paymentProviderError(
24751
24754
  "The original payment could not be verified.",
24752
24755
  "unknown"