From afe48d0ed912e32599d53dad590afa03964ed194 Mon Sep 17 00:00:00 2001 From: Charlie Cruzan Date: Thu, 1 Dec 2022 19:10:15 -0500 Subject: [PATCH] fixes after rebase --- example/src/screens/ApplePayScreen.tsx | 36 +++----------------------- src/types/PlatformPay.ts | 20 +++++++------- src/types/PushProvisioning.ts | 10 +++++-- 3 files changed, 21 insertions(+), 45 deletions(-) diff --git a/example/src/screens/ApplePayScreen.tsx b/example/src/screens/ApplePayScreen.tsx index bcc08ca3f..092989b17 100644 --- a/example/src/screens/ApplePayScreen.tsx +++ b/example/src/screens/ApplePayScreen.tsx @@ -1,13 +1,7 @@ import React, { useState } from 'react'; import { Alert, StyleSheet, Text, View } from 'react-native'; import { -<<<<<<< HEAD PlatformPay, -======= - ApplePayButton, - useApplePay, - ApplePay, ->>>>>>> 7a9c9d6 (revert unnecessary changes) AddToWalletButton, Constants, canAddCardToWallet, @@ -332,6 +326,7 @@ export default function ApplePayScreen() { - - {showAddToWalletButton && ( - { - Alert.alert( - error ? error.code : 'Success', - error - ? error.message - : 'Card was successfully added to the wallet.' - ); - }} - /> - )} - - )} + )} + ); } diff --git a/src/types/PlatformPay.ts b/src/types/PlatformPay.ts index 2419fa9d1..f7610568f 100644 --- a/src/types/PlatformPay.ts +++ b/src/types/PlatformPay.ts @@ -20,14 +20,14 @@ export type ApplePaySheetError = message?: string; }; -export const enum ApplePaySheetErrorType { +export enum ApplePaySheetErrorType { InvalidShippingAddress = 'InvalidShippingAddress', UnserviceableShippingAddress = 'UnserviceableShippingAddress', InvalidCouponCode = 'InvalidCouponCode', ExpiredCouponCode = 'ExpiredCouponCode', } -export const enum ContactField { +export enum ContactField { EmailAddress = 'emailAddress', Name = 'name', PhoneNumber = 'phoneNumber', @@ -35,7 +35,7 @@ export const enum ContactField { PostalAddress = 'postalAddress', } -export const enum InvalidShippingField { +export enum InvalidShippingField { Street = 'street', City = 'city', SubAdministrativeArea = 'subAdministrativeArea', @@ -76,7 +76,7 @@ export type ApplePayPaymentMethodParams = { couponCode?: string; }; -export const enum ApplePayMerchantCapability { +export enum ApplePayMerchantCapability { /** Required. This value must be supplied. */ Supports3DS = 'supports3DS', /** Optional. If present, only transactions that are categorized as credit cards are allowed. */ @@ -86,7 +86,7 @@ export const enum ApplePayMerchantCapability { } /** A type that indicates how to ship purchased items. */ -export const enum ApplePayShippingType { +export enum ApplePayShippingType { /** Default. */ Shipping = 'shipping', Delivery = 'delivery', @@ -140,7 +140,7 @@ export type GooglePayPaymentMethodParams = { }; }; -export const enum BillingAddressFormat { +export enum BillingAddressFormat { /** Collect name, street address, locality, region, country code, and postal code. */ Full = 'FULL', /** Collect name, country code, and postal code (default). */ @@ -161,7 +161,7 @@ export type ConfirmParams = { applePay?: ApplePayBaseParams; }; -export const enum ButtonType { +export enum ButtonType { /** A button with the Apple Pay or Google Pay logo only, useful when an additional call to action isn't needed. */ Default = 0, /** A button useful for product purchases. */ @@ -203,7 +203,7 @@ export const enum ButtonType { } /** iOS only. */ -export const enum ButtonStyle { +export enum ButtonStyle { /** A white button with black lettering. */ White = 0, /** A white button with black lettering and a black outline. */ @@ -221,7 +221,7 @@ export type CartSummaryItem = | RecurringCartSummaryItem; /** iOS only. */ -export const enum PaymentType { +export enum PaymentType { Deferred = 'Deferred', Immediate = 'Immediate', Recurring = 'Recurring', @@ -261,7 +261,7 @@ export type RecurringCartSummaryItem = { }; /** iOS only. */ -export const enum IntervalUnit { +export enum IntervalUnit { Minute = 'minute', Hour = 'hour', Day = 'day', diff --git a/src/types/PushProvisioning.ts b/src/types/PushProvisioning.ts index a76f46044..3b6c12735 100644 --- a/src/types/PushProvisioning.ts +++ b/src/types/PushProvisioning.ts @@ -9,7 +9,7 @@ export type GooglePayCardToken = { status: GooglePayCardTokenStatus; }; -export const enum GooglePayCardTokenStatus { +export enum GooglePayCardTokenStatus { /** */ TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION = 'TOKEN_STATE_NEEDS_IDENTITY_VERIFICATION', /** */ @@ -43,6 +43,8 @@ export type CanAddCardToWalletParams = { cardLastFour: string; /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */ testEnv?: boolean; + /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */ + hasPairedAppleWatch?: boolean; }; export type CanAddCardToWalletResult = @@ -60,11 +62,15 @@ export type CanAddCardToWalletResult = error: StripeError; }; -export const enum CanAddCardToWalletStatus { +export enum CanAddCardToWalletStatus { /** You are missing configuration required for Push Provisioning. Make sure you've completed all steps at https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native. */ MISSING_CONFIGURATION = 'MISSING_CONFIGURATION', /** This device doesn't support adding a card to the native wallet. */ UNSUPPORTED_DEVICE = 'UNSUPPORTED_DEVICE', /** This card already exists on this device and any paired devices. */ CARD_ALREADY_EXISTS = 'CARD_ALREADY_EXISTS', + /** This card already exists on this device, but not on the paired device. */ + CARD_EXISTS_ON_CURRENT_DEVICE = 'CARD_EXISTS_ON_CURRENT_DEVICE', + /** This card already exists on the paired device, but not on this device. */ + CARD_EXISTS_ON_PAIRED_DEVICE = 'CARD_EXISTS_ON_PAIRED_DEVICE', }