From 2f7e13ed13dda3d03c3e3b93a76bdb058a9f4515 Mon Sep 17 00:00:00 2001 From: Cesar Sosa Date: Mon, 20 Oct 2025 15:52:39 +0200 Subject: [PATCH] add verifyBuyer methods --- .../main/java/sqip/react/CardEntryModule.java | 144 ++++++++++- .../main/java/sqip/react/GooglePayModule.java | 182 ++++++++++++- ios/RNSQIPApplePay.h | 3 +- ios/RNSQIPApplePay.m | 239 +++++++++++++++++- ios/RNSQIPCardEntry.m | 141 ++++++++++- .../app/screens/HomeScreen.tsx | 142 +++++++++-- .../ios/Podfile.lock | 84 +++--- .../project.pbxproj | 97 ++++--- .../yarn.lock | 2 +- src/ApplePay.ts | 92 ++++++- src/CardEntry.ts | 85 +++++-- src/GooglePay.ts | 81 ++++++ yarn.lock | 70 ++--- 13 files changed, 1188 insertions(+), 174 deletions(-) diff --git a/android/src/main/java/sqip/react/CardEntryModule.java b/android/src/main/java/sqip/react/CardEntryModule.java index 1faa5f7c..f80e18ad 100644 --- a/android/src/main/java/sqip/react/CardEntryModule.java +++ b/android/src/main/java/sqip/react/CardEntryModule.java @@ -73,6 +73,12 @@ class CardEntryModule extends ReactContextBaseJavaModule { private Contact contact; private CardDetails cardResult; private String paymentSourceId; + private Boolean collectPostalCode; + + + private boolean shouldContinueWithGiftCardEntry = false; + private boolean shouldContinueWithCardEntry = false; + private boolean shouldListen = false; public CardEntryModule(final ReactApplicationContext reactContext) { super(reactContext); @@ -81,9 +87,15 @@ public CardEntryModule(final ReactApplicationContext reactContext) { cardDetailsConverter = new CardDetailsConverter(new CardConverter()); reference = new AtomicReference<>(); + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = false; + reactContext.addActivityEventListener(new BaseActivityEventListener() { @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) { + if (!CardEntryModule.this.shouldListen) return; + CardEntryModule.this.shouldListen = false; if (requestCode == CardEntry.DEFAULT_CARD_ENTRY_REQUEST_CODE) { CardEntry.handleActivityResult(data, new Callback() { @Override public void onResult(final CardEntryActivityResult cardEntryActivityResult) { @@ -121,19 +133,54 @@ public void run() { if(CardEntryModule.this.paymentSourceId == null) { WritableMap mapToReturn = cardDetailsConverter.toMapObject(CardEntryModule.this.cardResult); mapToReturn.putString("token", result.getSuccessValue().getVerificationToken()); - getDeviceEventEmitter().emit("onBuyerVerificationSuccess", mapToReturn); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("onBuyerVerificationSuccess", mapToReturn); + } + }); } else { WritableMap mapToReturn = new WritableNativeMap(); mapToReturn.putString("nonce", CardEntryModule.this.paymentSourceId); mapToReturn.putString("token", result.getSuccessValue().getVerificationToken()); - getDeviceEventEmitter().emit("onBuyerVerificationSuccess", mapToReturn); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("onBuyerVerificationSuccess", mapToReturn); + } + }); + } + if(CardEntryModule.this.shouldContinueWithGiftCardEntry) { + CardEntryModule.this.shouldContinueWithGiftCardEntry = false; + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + CardEntry.startGiftCardEntryActivity(Objects.requireNonNull(getCurrentActivity())); + } + }); + } + if(CardEntryModule.this.shouldContinueWithCardEntry) { + CardEntryModule.this.shouldContinueWithCardEntry = false; + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + CardEntry.startCardEntryActivity(Objects.requireNonNull(getCurrentActivity()), CardEntryModule.this.collectPostalCode); + } + }); } } else if (result.isError()) { + CardEntryModule.this.shouldContinueWithGiftCardEntry = false; + CardEntryModule.this.shouldContinueWithCardEntry = false; sqip.BuyerVerificationResult.Error error = result.getErrorValue(); WritableMap errorMap = ErrorHandlerUtils.getCallbackErrorObject(error.getCode().name(), error.getMessage(), error.getDebugCode(), error.getDebugMessage()); - getDeviceEventEmitter().emit("onBuyerVerificationError", errorMap); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("onBuyerVerificationError", errorMap); + } + }); } }); @@ -152,7 +199,12 @@ public CardEntryActivityCommand handleEnteredCardInBackground(CardDetails cardDe WritableMap mapToReturn = cardDetailsConverter.toMapObject(cardDetails); countDownLatch = new CountDownLatch(1); - getDeviceEventEmitter().emit("cardEntryDidObtainCardDetails", mapToReturn); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("cardEntryDidObtainCardDetails", mapToReturn); + } + }); try { // completeCardEntry or showCardNonceProcessingError must be called, // otherwise the thread will be leaked. @@ -173,6 +225,9 @@ public String getName() { @ReactMethod public void startCardEntryFlow(final Boolean collectPostalCode, final Promise promise) { + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; mainLooperHandler.post(new Runnable() { @Override public void run() { @@ -184,6 +239,9 @@ public void run() { @ReactMethod public void startGiftCardEntryFlow(final Promise promise) { + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; mainLooperHandler.post(new Runnable() { @Override public void run() { @@ -207,39 +265,102 @@ public void startBuyerVerificationFlow( final String paymentSourceId, final Stri this.buyerAction = buyerAction; this.contact = contact; + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; + VerificationParameters verificationParameters = new VerificationParameters(CardEntryModule.this.paymentSourceId, CardEntryModule.this.buyerAction, CardEntryModule.this.squareIdentifier, CardEntryModule.this.contact); - BuyerVerification.verify(Objects.requireNonNull(getCurrentActivity()), verificationParameters); + + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + BuyerVerification.verify(Objects.requireNonNull(getCurrentActivity()), verificationParameters); + } + }); promise.resolve(null); } @ReactMethod public void startCardEntryFlowWithVerification( - final Boolean collectPostalCode, final String locationId, final String buyerActionString, - final ReadableMap moneyMap, final ReadableMap contactMap, final Promise promise) { + final String paymentSourceId, + final String locationId, + final String buyerActionString, + final Boolean collectPostalCode, + final ReadableMap moneyMap, + final ReadableMap contactMap, + final Promise promise) { Money money = getMoney(moneyMap); BuyerAction buyerAction = getBuyerAction(buyerActionString, money); Contact contact = getContact(contactMap); SquareIdentifier squareIdentifier = new SquareIdentifier.LocationToken(locationId); - this.paymentSourceId = null; + this.paymentSourceId = paymentSourceId; + this.squareIdentifier = squareIdentifier; + this.buyerAction = buyerAction; + this.contact = contact; + this.collectPostalCode = collectPostalCode; + + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = true; + this.shouldListen = true; + + VerificationParameters verificationParameters = + new VerificationParameters(CardEntryModule.this.paymentSourceId, CardEntryModule.this.buyerAction, CardEntryModule.this.squareIdentifier, + CardEntryModule.this.contact); + + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + BuyerVerification.verify(Objects.requireNonNull(getCurrentActivity()), verificationParameters); + } + }); + promise.resolve(null); + } + + @ReactMethod + public void startGiftCardEntryFlowWithVerification( + final String paymentSourceId, + final String locationId, + final String buyerActionString, + final ReadableMap moneyMap, + final ReadableMap contactMap, + final Promise promise + ) { + Money money = getMoney(moneyMap); + BuyerAction buyerAction = getBuyerAction(buyerActionString, money); + Contact contact = getContact(contactMap); + + SquareIdentifier squareIdentifier = new SquareIdentifier.LocationToken(locationId); + + this.paymentSourceId = paymentSourceId; this.squareIdentifier = squareIdentifier; this.buyerAction = buyerAction; this.contact = contact; + this.shouldContinueWithGiftCardEntry = true; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; + + VerificationParameters verificationParameters = + new VerificationParameters(CardEntryModule.this.paymentSourceId, CardEntryModule.this.buyerAction, CardEntryModule.this.squareIdentifier, + CardEntryModule.this.contact); mainLooperHandler.post(new Runnable() { @Override public void run() { - CardEntry.startCardEntryActivity(Objects.requireNonNull(getCurrentActivity()), collectPostalCode); - promise.resolve(null); + BuyerVerification.verify(Objects.requireNonNull(getCurrentActivity()), verificationParameters); } }); + promise.resolve(null); } @ReactMethod public void completeCardEntry(Promise promise) { + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; reference.set(new CardEntryActivityCommand.Finish()); countDownLatch.countDown(); promise.resolve(null); @@ -247,6 +368,9 @@ public void completeCardEntry(Promise promise) { @ReactMethod public void showCardNonceProcessingError(String errorMessage, Promise promise) { + this.shouldContinueWithGiftCardEntry = false; + this.shouldContinueWithCardEntry = false; + this.shouldListen = true; reference.set(new CardEntryActivityCommand.ShowError(errorMessage)); countDownLatch.countDown(); promise.resolve(null); diff --git a/android/src/main/java/sqip/react/GooglePayModule.java b/android/src/main/java/sqip/react/GooglePayModule.java index 461b6e0a..f234ad6a 100644 --- a/android/src/main/java/sqip/react/GooglePayModule.java +++ b/android/src/main/java/sqip/react/GooglePayModule.java @@ -19,12 +19,18 @@ import android.content.Intent; import android.os.Handler; import android.os.Looper; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.view.animation.Animation; import androidx.annotation.NonNull; import com.facebook.react.bridge.BaseActivityEventListener; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableMap; +import com.facebook.react.bridge.WritableMap; +import com.facebook.react.bridge.WritableNativeMap; import com.facebook.react.modules.core.DeviceEventManagerModule; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; @@ -36,14 +42,24 @@ import com.google.android.gms.wallet.TransactionInfo; import com.google.android.gms.wallet.Wallet; import java.util.Objects; +import java.util.ArrayList; import sqip.Callback; +import sqip.BuyerAction; +import sqip.BuyerVerification; +import sqip.Contact; +import sqip.Country; import sqip.GooglePay; import sqip.GooglePayNonceResult; +import sqip.Money; +import sqip.SquareIdentifier; +import sqip.VerificationParameters; import sqip.react.internal.ErrorHandlerUtils; import sqip.react.internal.InAppPaymentsException; import sqip.react.internal.converter.CardConverter; import sqip.react.internal.converter.CardDetailsConverter; +import static android.view.animation.AnimationUtils.loadAnimation; + class GooglePayModule extends ReactContextBaseJavaModule { // Android only sqip.react plugin errors and messages @@ -64,15 +80,31 @@ class GooglePayModule extends ReactContextBaseJavaModule { private String squareLocationId; private PaymentsClient googlePayClients; + private String paymentSourceId; + private SquareIdentifier squareIdentifier; + private BuyerAction buyerAction; + private Contact contact; + private String price; + private String currencyCode; + private int priceStatus; + + private boolean shouldListen = false; + private boolean shouldContinueWithGooglePayNonceRequest = false; + public GooglePayModule(ReactApplicationContext reactContext) { super(reactContext); this.reactContext = reactContext; mainLooperHandler = new Handler(Looper.getMainLooper()); cardDetailsConverter = new CardDetailsConverter(new CardConverter()); + this.shouldContinueWithGooglePayNonceRequest = false; + this.shouldListen = false; + reactContext.addActivityEventListener(new BaseActivityEventListener() { @Override public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) { + if (!GooglePayModule.this.shouldListen) return; + GooglePayModule.this.shouldListen = false; if (requestCode == LOAD_PAYMENT_DATA_REQUEST_CODE) { switch (resultCode) { case Activity.RESULT_OK: @@ -94,7 +126,7 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode, } } }); - break; + break; case Activity.RESULT_CANCELED: getDeviceEventEmitter().emit("onGooglePayCanceled", null); break; @@ -111,6 +143,54 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode, RN_MESSAGE_GOOGLE_PAY_UNKNOWN_ERROR)); } } + if (requestCode == BuyerVerification.DEFAULT_BUYER_VERIFICATION_REQUEST_CODE) { + BuyerVerification.handleActivityResult(data, result -> { + if (result.isSuccess()) { + if(GooglePayModule.this.paymentSourceId != null) { + WritableMap mapToReturn = new WritableNativeMap(); + mapToReturn.putString("nonce", GooglePayModule.this.paymentSourceId); + mapToReturn.putString("token", result.getSuccessValue().getVerificationToken()); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("onBuyerVerificationSuccessFromGooglePay", mapToReturn); + } + }); + } + if(GooglePayModule.this.shouldContinueWithGooglePayNonceRequest) { + GooglePayModule.this.shouldContinueWithGooglePayNonceRequest = false; + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + AutoResolveHelper.resolveTask( + googlePayClients.loadPaymentData( + createPaymentChargeRequest( + GooglePayModule.this.squareLocationId, + GooglePayModule.this.price, + GooglePayModule.this.currencyCode, + GooglePayModule.this.priceStatus)), + Objects.requireNonNull(getCurrentActivity()), + LOAD_PAYMENT_DATA_REQUEST_CODE); + } + }); + } + } else if (result.isError()) { + GooglePayModule.this.shouldContinueWithGooglePayNonceRequest = false; + sqip.BuyerVerificationResult.Error error = result.getErrorValue(); + WritableMap errorMap = + ErrorHandlerUtils.getCallbackErrorObject(error.getCode().name(), error.getMessage(), error.getDebugCode(), + error.getDebugMessage()); + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + getDeviceEventEmitter().emit("onBuyerVerificationErrorFromGooglePay", errorMap); + } + }); + } + }); + + GooglePayModule.this.contact = null; + } } }); } @@ -157,6 +237,8 @@ public void requestGooglePayNonce(final String price, final String currencyCode, promise.reject(ErrorHandlerUtils.USAGE_ERROR, new InAppPaymentsException(errorJsonMessage)); return; } + shouldListen = true; + this.shouldContinueWithGooglePayNonceRequest = false; mainLooperHandler.post(new Runnable() { @Override @@ -170,6 +252,57 @@ public void run() { }); } + @ReactMethod + public void requestGooglePayNonceWithVerification( + final String paymentSourceId, + final String locationId, + final String buyerActionString, + final ReadableMap moneyMap, + final ReadableMap contactMap, + final String price, + final String currencyCode, + final int priceStatus, + final Promise promise) { + + if (googlePayClients == null) { + String errorJsonMessage = ErrorHandlerUtils.createNativeModuleError( + RN_GOOGLE_PAY_NOT_INITIALIZED, RN_MESSAGE_GOOGLE_PAY_NOT_INITIALIZED); + promise.reject(ErrorHandlerUtils.USAGE_ERROR, new InAppPaymentsException(errorJsonMessage)); + return; + } + + Money money = getMoney(moneyMap); + BuyerAction buyerAction = getBuyerAction(buyerActionString, money); + Contact contact = getContact(contactMap); + SquareIdentifier squareIdentifier = new SquareIdentifier.LocationToken(locationId); + + this.paymentSourceId = paymentSourceId; + this.squareIdentifier = squareIdentifier; + this.buyerAction = buyerAction; + this.contact = contact; + this.price = price; + this.currencyCode = currencyCode; + this.priceStatus = priceStatus; + + shouldListen = true; + this.shouldContinueWithGooglePayNonceRequest = true; + + VerificationParameters verificationParameters = + new VerificationParameters( + GooglePayModule.this.paymentSourceId, + GooglePayModule.this.buyerAction, + GooglePayModule.this.squareIdentifier, + GooglePayModule.this.contact); + + mainLooperHandler.post(new Runnable() { + @Override + public void run() { + BuyerVerification.verify(Objects.requireNonNull(getCurrentActivity()), verificationParameters); + } + }); + promise.resolve(null); + } + private PaymentDataRequest createPaymentChargeRequest(String squareLocationId, String price, String currencyCode, int priceStatus) { TransactionInfo transactionInfo = TransactionInfo.newBuilder() .setTotalPriceStatus(priceStatus) @@ -185,6 +318,53 @@ private DeviceEventManagerModule.RCTDeviceEventEmitter getDeviceEventEmitter() { } return deviceEventEmitter; } + + private Contact getContact(final ReadableMap contactMap) { + + // Contact info + String givenName = contactMap.hasKey("givenName") ? contactMap.getString("givenName") : ""; + String familyName = contactMap.hasKey("familyName") ? contactMap.getString("familyName") : ""; + ArrayList inputList = + contactMap.hasKey("addressLines") ? contactMap.getArray("addressLines").toArrayList() : new ArrayList(); + ArrayList addressLines = new ArrayList<>(inputList.size()); + for (Object object : inputList) { + addressLines.add(Objects.toString(object, null)); + } + String city = contactMap.hasKey("city") ? contactMap.getString("city") : ""; + String countryCode = contactMap.hasKey("countryCode") ? contactMap.getString("countryCode") : ""; + String email = contactMap.hasKey("email") ? contactMap.getString("email") : ""; + String phone = contactMap.hasKey("phone") ? contactMap.getString("phone") : ""; + String postalCode = contactMap.hasKey("postalCode") ? contactMap.getString("postalCode") : ""; + String region = contactMap.hasKey("region") ? contactMap.getString("region") : ""; + Country country = Country.valueOf((countryCode != null) ? countryCode : "US"); + return new Contact.Builder() + .familyName(familyName) + .email(email) + .addressLines(addressLines) + .city(city) + .countryCode(country) + .postalCode(postalCode) + .phone(phone) + .region(region) + .build(givenName); + } + + private Money getMoney(final ReadableMap moneyMap) { + return new Money( + ((Integer)moneyMap.getInt("amount")), + sqip.Currency.valueOf((String)moneyMap.getString("currencyCode"))); + } + + private BuyerAction getBuyerAction(final String buyerActionString, final Money money) { + BuyerAction buyerAction; + if (buyerActionString.equals("Store")) { + buyerAction = new BuyerAction.Store(); + } else { + buyerAction = new BuyerAction.Charge(money); + } + return buyerAction; + } + @ReactMethod public void addListener(String eventName) { diff --git a/ios/RNSQIPApplePay.h b/ios/RNSQIPApplePay.h index e6950a5f..10ffdffa 100644 --- a/ios/RNSQIPApplePay.h +++ b/ios/RNSQIPApplePay.h @@ -21,8 +21,9 @@ #import "RCTBridgeModule.h" #import "RCTEventEmitter.h" #endif -@import SquareInAppPaymentsSDK; +@import SquareInAppPaymentsSDK; +@import SquareBuyerVerificationSDK; @interface RNSQIPApplePay : RCTEventEmitter diff --git a/ios/RNSQIPApplePay.m b/ios/RNSQIPApplePay.m index 1ce79a27..b0503c9c 100644 --- a/ios/RNSQIPApplePay.m +++ b/ios/RNSQIPApplePay.m @@ -17,7 +17,11 @@ #import "RNSQIPApplePay.h" #import #import "RNSQIPErrorUtilities.h" +#import "RNSQIPBuyerVerification.h" +#import "Converters/SQIPCard+RNSQIPAdditions.h" #import "Converters/SQIPCardDetails+RNSQIPAdditions.h" +#import "Converters/UIFont+RNSQIPAdditions.h" +#import "Converters/UIColor+RNSQIPAdditions.h" API_AVAILABLE(ios(11.0)) typedef void (^CompletionHandler)(PKPaymentAuthorizationResult *_Nonnull); @@ -26,11 +30,15 @@ API_AVAILABLE(ios(11.0)) @interface RNSQIPApplePay () +@property (strong, readwrite) SQIPTheme *theme; @property (strong, readwrite) NSString *applePayMerchantId; @property (strong, readwrite) CompletionHandler completionHandler; @end +static NSString *const RNSQIPOnBuyerVerificationSuccessEventName = @"onBuyerVerificationSuccessFromApplePay"; +static NSString *const RNSQIPOnBuyerVerificationErrorEventName = @"onBuyerVerificationErrorFromApplePay"; + // react native plugin debug error codes static NSString *const RNSQIPApplePayNotInitialized = @"rn_apple_pay_not_initialized"; static NSString *const RNSQIPApplePayNotSupport = @"rn_apple_pay_not_supported"; @@ -51,7 +59,13 @@ - (dispatch_queue_t)methodQueue - (NSArray *)supportedEvents { - return @[ @"onApplePayNonceRequestSuccess", @"onApplePayNonceRequestFailure", @"onApplePayComplete" ]; + return @[ + @"onApplePayNonceRequestSuccess", + @"onApplePayNonceRequestFailure", + @"onApplePayComplete", + RNSQIPOnBuyerVerificationSuccessEventName, + RNSQIPOnBuyerVerificationErrorEventName + ]; } RCT_REMAP_METHOD(initializeApplePay, @@ -133,6 +147,161 @@ - (dispatch_queue_t)methodQueue }); } +RCT_REMAP_METHOD(requestApplePayNonceWithVerification, + paymentSourceId + : (NSString *)paymentSourceId + locationId + : (NSString *)locationId + buyerActionString + : (NSString *)buyerActionString + moneyMap + : (NSDictionary *)moneyMap + contactMap + : (NSDictionary *)contactMap + price + : (NSString *)price + summaryLabel + : (NSString *)summaryLabel + countryCode + : (NSString *)countryCode + currencyCode + : (NSString *)currencyCode + paymentType + : (nonnull NSNumber *)paymentType + requestApplePayNonceWithResolver + : (RCTPromiseResolveBlock)resolve + rejecter + : (RCTPromiseRejectBlock)reject) +{ + if (!self.applePayMerchantId) { + reject(RNSQIPUsageError, [RNSQIPErrorUtilities createNativeModuleError:RNSQIPApplePayNotInitialized debugMessage:RNSQIPMessageApplePayNotInitialized], nil); + return; + } + if (!SQIPInAppPaymentsSDK.canUseApplePay) { + reject(RNSQIPUsageError, [RNSQIPErrorUtilities createNativeModuleError:RNSQIPApplePayNotSupport debugMessage:RNSQIPMessageApplePayNotSupported], nil); + return; + } + dispatch_async([self methodQueue], ^{ + SQIPMoney *money = [self _getMoney:moneyMap]; + SQIPBuyerAction *buyerAction = [self _getBuyerAction:buyerActionString money:money]; + SQIPContact *contact = [self _getContact:contactMap]; + + UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + + SQIPVerificationParameters *params = [[SQIPVerificationParameters alloc] initWithPaymentSourceID:paymentSourceId + buyerAction:buyerAction + locationID:locationId + contact:contact]; + + if ([rootViewController isKindOfClass:[UINavigationController class]]) { + [rootViewController.navigationController popViewControllerAnimated:YES]; + } else { + [rootViewController dismissViewControllerAnimated:YES completion:nil]; + } + + if (self.theme == nil) { + self.theme = [[SQIPTheme alloc] init]; + } + [SQIPBuyerVerificationSDK.shared verifyWithParameters:params + theme:self.theme + viewController:rootViewController + success:^(SQIPBuyerVerifiedDetails *_Nonnull verifiedDetails) { + NSDictionary *verificationResult = + @{ + @"nonce" : paymentSourceId, + @"token" : verifiedDetails.verificationToken + }; + + [self sendEventWithName:RNSQIPOnBuyerVerificationSuccessEventName + body:verificationResult]; + + PKPaymentRequest *paymentRequest = + [PKPaymentRequest squarePaymentRequestWithMerchantIdentifier:self.applePayMerchantId + countryCode:countryCode + currencyCode:currencyCode]; + if ([paymentType integerValue] == 1) { + paymentRequest.paymentSummaryItems = @[ + [PKPaymentSummaryItem summaryItemWithLabel:summaryLabel + amount:[NSDecimalNumber decimalNumberWithString:price] + type:PKPaymentSummaryItemTypePending] + ]; + } else { + paymentRequest.paymentSummaryItems = @[ + [PKPaymentSummaryItem summaryItemWithLabel:summaryLabel + amount:[NSDecimalNumber decimalNumberWithString:price] + type:PKPaymentSummaryItemTypeFinal] + ]; + } + PKPaymentAuthorizationViewController *paymentAuthorizationViewController = + [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:paymentRequest]; + paymentAuthorizationViewController.delegate = self; + UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + [rootViewController presentViewController:paymentAuthorizationViewController animated:NO completion:nil]; + } + failure:^(NSError *_Nonnull error) { + NSString *debugCode = error.userInfo[SQIPErrorDebugCodeKey]; + NSString *debugMessage = error.userInfo[SQIPErrorDebugMessageKey]; + [self sendEventWithName:RNSQIPOnBuyerVerificationErrorEventName + body:[RNSQIPErrorUtilities callbackErrorObject:RNSQIPUsageError + message:error.localizedDescription + debugCode:debugCode + debugMessage:debugMessage]]; + }]; + resolve([NSNull null]); + }); +} + +RCT_REMAP_METHOD(setTheme, + theme + : (NSDictionary *)theme + setThemeWithResolver + : (RCTPromiseResolveBlock)resolve + rejecter + : (RCTPromiseRejectBlock)reject) +{ + dispatch_async([self methodQueue], ^{ + // Create a new theme with default value + self.theme = [[SQIPTheme alloc] init]; + if (theme[@"font"]) { + self.theme.font = [self.theme.font fromJsonDictionary:theme[@"font"]]; + } + if (theme[@"saveButtonFont"]) { + self.theme.saveButtonFont = [self.theme.saveButtonFont fromJsonDictionary:theme[@"saveButtonFont"]]; + } + if (theme[@"backgroundColor"]) { + self.theme.backgroundColor = [self.theme.backgroundColor fromJsonDictionary:theme[@"backgroundColor"]]; + } + if (theme[@"foregroundColor"]) { + self.theme.foregroundColor = [self.theme.foregroundColor fromJsonDictionary:theme[@"foregroundColor"]]; + } + if (theme[@"textColor"]) { + self.theme.textColor = [self.theme.textColor fromJsonDictionary:theme[@"textColor"]]; + } + if (theme[@"placeholderTextColor"]) { + self.theme.placeholderTextColor = [self.theme.placeholderTextColor fromJsonDictionary:theme[@"placeholderTextColor"]]; + } + if (theme[@"tintColor"]) { + self.theme.tintColor = [self.theme.tintColor fromJsonDictionary:theme[@"tintColor"]]; + } + if (theme[@"messageColor"]) { + self.theme.messageColor = [self.theme.messageColor fromJsonDictionary:theme[@"messageColor"]]; + } + if (theme[@"errorColor"]) { + self.theme.errorColor = [self.theme.errorColor fromJsonDictionary:theme[@"errorColor"]]; + } + if (theme[@"saveButtonTitle"]) { + self.theme.saveButtonTitle = theme[@"saveButtonTitle"]; + } + if (theme[@"saveButtonTextColor"]) { + self.theme.saveButtonTextColor = [self.theme.saveButtonTextColor fromJsonDictionary:theme[@"saveButtonTextColor"]]; + } + if (theme[@"keyboardAppearance"]) { + self.theme.keyboardAppearance = [self _keyboardAppearanceFromString:theme[@"keyboardAppearance"]]; + } + resolve([NSNull null]); + }); +} + RCT_REMAP_METHOD(completeApplePayAuthorization, isSuccess : (BOOL)isSuccess @@ -202,4 +371,72 @@ - (void)paymentAuthorizationViewControllerDidFinish:(nonnull PKPaymentAuthorizat [self sendEventWithName:@"onApplePayComplete" body:nil]; } +#pragma mark - Private Methods + +- (UIKeyboardAppearance)_keyboardAppearanceFromString:(NSString *)keyboardTypeName +{ + if ([keyboardTypeName isEqualToString:@"Dark"]) { + return UIKeyboardAppearanceDark; + } else if ([keyboardTypeName isEqualToString:@"Light"]) { + return UIKeyboardAppearanceLight; + } else { + return UIKeyboardAppearanceDefault; + } +} + +- (SQIPMoney *)_getMoney:(NSDictionary *)moneyMap { + SQIPMoney *money = [[SQIPMoney alloc] initWithAmount:[moneyMap[@"amount"] longValue] + currency:[RNSQIPBuyerVerification currencyForCurrencyCode:moneyMap[@"currencyCode"]]]; + return money; +} + +- (SQIPBuyerAction *)_getBuyerAction:(NSString *)buyerActionString money:(SQIPMoney *)money { + SQIPBuyerAction *buyerAction = nil; + if ([@"Store" isEqualToString:buyerActionString]) { + buyerAction = [SQIPBuyerAction storeAction]; + } else { + buyerAction = [SQIPBuyerAction chargeActionWithMoney:money]; + } + return buyerAction; +} + +- (SQIPContact *)_getContact:(NSDictionary *)contactMap { + SQIPContact *contact = [[SQIPContact alloc] init]; + contact.givenName = contactMap[@"givenName"]; + + if (![contactMap[@"familyName"] isEqual:[NSNull null]]) { + contact.familyName = contactMap[@"familyName"]; + } + + if (![contactMap[@"email"] isEqual:[NSNull null]]) { + contact.email = contactMap[@"email"]; + } + + if (![contactMap[@"addressLines"] isEqual:[NSNull null]]) { + contact.addressLines = contactMap[@"addressLines"]; + NSLog(@"%@", contactMap[@"addressLines"]); + } + + if (![contactMap[@"city"] isEqual:[NSNull null]]) { + contact.city = contactMap[@"city"]; + } + + if (![contactMap[@"region"] isEqual:[NSNull null]]) { + contact.region = contactMap[@"region"]; + } + + if (![contactMap[@"postalCode"] isEqual:[NSNull null]]) { + contact.postalCode = contactMap[@"postalCode"]; + } + + contact.country = [RNSQIPBuyerVerification countryForCountryCode:contactMap[@"countryCode"]]; + + if (![contactMap[@"phone"] isEqual:[NSNull null]]) { + contact.phone = contactMap[@"phone"]; + } + + return contact; +} + + @end diff --git a/ios/RNSQIPCardEntry.m b/ios/RNSQIPCardEntry.m index 82bfcd93..cc8999ae 100644 --- a/ios/RNSQIPCardEntry.m +++ b/ios/RNSQIPCardEntry.m @@ -83,12 +83,14 @@ - (dispatch_queue_t)methodQueue } RCT_REMAP_METHOD(startCardEntryFlowWithVerification, - collectPostalCode - : (BOOL)collectPostalCode + paymentSourceId + : (NSString *)paymentSourceId locationId : (NSString *)locationId buyerActionString : (NSString *)buyerActionString + collectPostalCode + : (BOOL)collectPostalCode moneyMap : (NSDictionary *)moneyMap contactMap @@ -106,18 +108,59 @@ - (dispatch_queue_t)methodQueue self.locationId = locationId; self.buyerAction = buyerAction; self.contact = contact; - SQIPCardEntryViewController *cardEntryForm = [self _makeCardEntryForm]; - cardEntryForm.collectPostalCode = collectPostalCode; - cardEntryForm.delegate = self; - self.cardEntryViewController = cardEntryForm; UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + + + SQIPVerificationParameters *params = [[SQIPVerificationParameters alloc] initWithPaymentSourceID:paymentSourceId + buyerAction:self.buyerAction + locationID:self.locationId + contact:self.contact]; + if ([rootViewController isKindOfClass:[UINavigationController class]]) { - [((UINavigationController *)rootViewController) pushViewController:cardEntryForm animated:YES]; + [rootViewController.navigationController popViewControllerAnimated:YES]; } else { - UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:cardEntryForm]; - [rootViewController presentViewController:navigationController animated:YES completion:nil]; + [rootViewController dismissViewControllerAnimated:YES completion:nil]; } + + if (self.theme == nil) { + self.theme = [[SQIPTheme alloc] init]; + } + [SQIPBuyerVerificationSDK.shared verifyWithParameters:params + theme:self.theme + viewController:rootViewController + success:^(SQIPBuyerVerifiedDetails *_Nonnull verifiedDetails) { + NSDictionary *verificationResult = + @{ + @"nonce" : paymentSourceId, + @"token" : verifiedDetails.verificationToken + }; + + [self sendEventWithName:RNSQIPOnBuyerVerificationSuccessEventName + body:verificationResult]; + + SQIPCardEntryViewController *cardEntryForm = [self _makeCardEntryForm]; + cardEntryForm.collectPostalCode = collectPostalCode; + cardEntryForm.delegate = self; + self.cardEntryViewController = cardEntryForm; + + UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + if ([rootViewController isKindOfClass:[UINavigationController class]]) { + [((UINavigationController *)rootViewController) pushViewController:cardEntryForm animated:YES]; + } else { + UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:cardEntryForm]; + [rootViewController presentViewController:navigationController animated:YES completion:nil]; + } + } + failure:^(NSError *_Nonnull error) { + NSString *debugCode = error.userInfo[SQIPErrorDebugCodeKey]; + NSString *debugMessage = error.userInfo[SQIPErrorDebugMessageKey]; + [self sendEventWithName:RNSQIPOnBuyerVerificationErrorEventName + body:[RNSQIPErrorUtilities callbackErrorObject:RNSQIPUsageError + message:error.localizedDescription + debugCode:debugCode + debugMessage:debugMessage]]; + }]; resolve([NSNull null]); }); } @@ -212,6 +255,86 @@ - (dispatch_queue_t)methodQueue }); } +RCT_REMAP_METHOD(startGiftCardEntryFlowWithVerification, + gce_paymentSourceId + : (NSString *)gce_paymentSourceId + locationId + : (NSString *)locationId + buyerActionString + : (NSString *)buyerActionString + moneyMap + : (NSDictionary *)moneyMap + contactMap + : (NSDictionary *)contactMap + startCardEntryFlowWithResolver + : (RCTPromiseResolveBlock)resolve + rejecter + : (RCTPromiseRejectBlock)reject) +{ + dispatch_async([self methodQueue], ^{ + SQIPMoney *money = [self _getMoney:moneyMap]; + SQIPBuyerAction *buyerAction = [self _getBuyerAction:buyerActionString money:money]; + SQIPContact *contact = [self _getContact:contactMap]; + + self.locationId = locationId; + self.buyerAction = buyerAction; + self.contact = contact; + + UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + + + SQIPVerificationParameters *params = [[SQIPVerificationParameters alloc] initWithPaymentSourceID:gce_paymentSourceId + buyerAction:self.buyerAction + locationID:self.locationId + contact:self.contact]; + + if ([rootViewController isKindOfClass:[UINavigationController class]]) { + [rootViewController.navigationController popViewControllerAnimated:YES]; + } else { + [rootViewController dismissViewControllerAnimated:YES completion:nil]; + } + + if (self.theme == nil) { + self.theme = [[SQIPTheme alloc] init]; + } + [SQIPBuyerVerificationSDK.shared verifyWithParameters:params + theme:self.theme + viewController:rootViewController + success:^(SQIPBuyerVerifiedDetails *_Nonnull verifiedDetails) { + NSDictionary *verificationResult = + @{ + @"nonce" : gce_paymentSourceId, + @"token" : verifiedDetails.verificationToken + }; + + [self sendEventWithName:RNSQIPOnBuyerVerificationSuccessEventName + body:verificationResult]; + + SQIPCardEntryViewController *cardEntryForm = [self _makeGiftCardEntryForm]; + cardEntryForm.delegate = self; + self.cardEntryViewController = cardEntryForm; + + UIViewController *rootViewController = UIApplication.sharedApplication.keyWindow.rootViewController; + if ([rootViewController isKindOfClass:[UINavigationController class]]) { + [((UINavigationController *)rootViewController) pushViewController:cardEntryForm animated:YES]; + } else { + UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:cardEntryForm]; + [rootViewController presentViewController:navigationController animated:YES completion:nil]; + } + } + failure:^(NSError *_Nonnull error) { + NSString *debugCode = error.userInfo[SQIPErrorDebugCodeKey]; + NSString *debugMessage = error.userInfo[SQIPErrorDebugMessageKey]; + [self sendEventWithName:RNSQIPOnBuyerVerificationErrorEventName + body:[RNSQIPErrorUtilities callbackErrorObject:RNSQIPUsageError + message:error.localizedDescription + debugCode:debugCode + debugMessage:debugMessage]]; + }]; + resolve([NSNull null]); + }); +} + RCT_REMAP_METHOD(completeCardEntry, completeCardEntryWithResolver : (RCTPromiseResolveBlock)resolve diff --git a/react-native-in-app-payments-quickstart/app/screens/HomeScreen.tsx b/react-native-in-app-payments-quickstart/app/screens/HomeScreen.tsx index 2ddbb8f8..9b8472f1 100644 --- a/react-native-in-app-payments-quickstart/app/screens/HomeScreen.tsx +++ b/react-native-in-app-payments-quickstart/app/screens/HomeScreen.tsx @@ -392,14 +392,17 @@ export default function HomeScreen() { }; const googlePayLocationIsSet = () => { + //@ts-ignore return GOOGLE_PAY_LOCATION_ID !== 'REPLACE_ME'; }; const applePayMerchantIsSet = () => { + //@ts-ignore return APPLE_PAY_MERCHANT_ID !== 'REPLACE_ME'; }; const customerIdIsSet = () => { + //@ts-ignore return CUSTOMER_ID !== 'REPLACE_ME'; }; @@ -476,6 +479,18 @@ export default function HomeScreen() { setshowingCardEntry(false); const cardEntryConfig = { collectPostalCode: true, + squareLocationId: SQUARE_LOCATION_ID, + buyerAction: 'Charge', + amount: 100, + currencyCode: 'USD', + givenName: 'John', + familyName: 'Doe', + addressLines: ['London Eye', 'Riverside Walk'], + city: 'London', + countryCode: 'GB', + email: 'johndoe@example.com', + phone: '8001234567', + postalCode: 'SE1 7', }; if (Platform.OS === 'ios') { await SQIPCardEntry.setIOSCardEntryTheme({ @@ -483,8 +498,13 @@ export default function HomeScreen() { saveButtonTitle: 'Pay 🍪', }); } - await SQIPCardEntry.startCardEntryFlow( + const paymentSourceId = 'ccof:customer-card-id-requires-verification'; + + await SQIPCardEntry.startCardEntryFlowWithBuyerVerification( cardEntryConfig, + paymentSourceId, + onBuyerVerificationSuccess, + onBuyerVerificationFailure, onCardNonceRequestSuccess, onCardEntryCancel, ); @@ -499,9 +519,30 @@ export default function HomeScreen() { saveButtonTitle: 'Pay 🍪', }); } - await SQIPCardEntry.startGiftCardEntryFlow( - onCardNonceRequestSuccess, + const paymentSourceId = 'ccof:customer-card-id-requires-verification'; + const cardEntryConfig = { + collectPostalCode: true, + squareLocationId: SQUARE_LOCATION_ID, + buyerAction: 'Charge', + amount: 100, + currencyCode: 'USD', + givenName: 'John', + familyName: 'Doe', + addressLines: ['London Eye', 'Riverside Walk'], + city: 'London', + countryCode: 'GB', + email: 'johndoe@example.com', + phone: '8001234567', + postalCode: 'SE1 7', + }; + + await SQIPCardEntry.startGiftCardEntryFlowWithBuyerVerification( + paymentSourceId, + cardEntryConfig, + onBuyerVerificationSuccess, + onBuyerVerificationFailure, onCardEntryCancel, + onCardNonceRequestSuccess, ); }; @@ -509,6 +550,18 @@ export default function HomeScreen() { setshowingCustomerCardEntry(false); const cardEntryConfig = { collectPostalCode: true, + squareLocationId: SQUARE_LOCATION_ID, + buyerAction: 'Charge', + amount: 100, + currencyCode: 'USD', + givenName: 'John', + familyName: 'Doe', + addressLines: ['London Eye', 'Riverside Walk'], + city: 'London', + countryCode: 'GB', + email: 'johndoe@example.com', + phone: '8001234567', + postalCode: 'SE1 7', }; if (Platform.OS === 'ios') { await SQIPCardEntry.setIOSCardEntryTheme({ @@ -516,10 +569,15 @@ export default function HomeScreen() { saveButtonTitle: 'Save 🍪', }); } - await SQIPCardEntry.startCardEntryFlow( + const paymentSourceId = 'ccof:customer-card-id-requires-verification'; + + await SQIPCardEntry.startCardEntryFlowWithBuyerVerification( cardEntryConfig, - onCustomerCardNonceRequestSuccess, - onCustomerCardEntryCancel, + paymentSourceId, + onBuyerVerificationSuccess, + onBuyerVerificationFailure, + onCardNonceRequestSuccess, + onCardEntryCancel, ); }; @@ -558,14 +616,36 @@ export default function HomeScreen() { false ); } else { - await SQIPApplePay.requestApplePayNonce( - { - price: '1.00', - summaryLabel: 'Test Item', - countryCode: 'US', - currencyCode: 'USD', - paymentType: SQIPApplePay.PaymentTypeFinal, - }, + const paymentSourceId = 'ccof:customer-card-id-requires-verification'; + const cardEntryConfig = { + collectPostalCode: true, + squareLocationId: SQUARE_LOCATION_ID, + buyerAction: 'Charge', + amount: 100, + currencyCode: 'USD', + givenName: 'John', + familyName: 'Doe', + addressLines: ['London Eye', 'Riverside Walk'], + city: 'London', + countryCode: 'GB', + email: 'johndoe@example.com', + phone: '8001234567', + postalCode: 'SE1 7', + }; + const applePayConfig = { + price: '1.00', + summaryLabel: 'Test Item', + countryCode: 'US', + currencyCode: 'USD', + paymentType: SQIPApplePay.PaymentTypeFinal, + }; + await SQIPApplePay.requestApplePayNonceWithBuyerVerification( + paymentSourceId, + cardEntryConfig, + applePayConfig, + onBuyerVerificationSuccess, + onBuyerVerificationFailure, + onCardEntryCancel, onApplePayRequestNonceSuccess, onApplePayRequestNonceFailure, onApplePayComplete, @@ -580,12 +660,34 @@ export default function HomeScreen() { false ); } else { - await SQIPGooglePay.requestGooglePayNonce( - { - price: '1.00', - currencyCode: 'USD', - priceStatus: SQIPGooglePay.TotalPriceStatusFinal, - }, + const paymentSourceId = 'ccof:customer-card-id-requires-verification'; + const cardEntryConfig = { + collectPostalCode: true, + squareLocationId: SQUARE_LOCATION_ID, + buyerAction: 'Charge', + amount: 100, + currencyCode: 'USD', + givenName: 'John', + familyName: 'Doe', + addressLines: ['London Eye', 'Riverside Walk'], + city: 'London', + countryCode: 'GB', + email: 'johndoe@example.com', + phone: '8001234567', + postalCode: 'SE1 7', + }; + const googlePayConfig = { + price: '1.00', + currencyCode: 'USD', + priceStatus: SQIPGooglePay.TotalPriceStatusFinal, + }; + await SQIPGooglePay.requestGooglePayNonceWithBuyerVerification( + paymentSourceId, + cardEntryConfig, + googlePayConfig, + onBuyerVerificationSuccess, + onBuyerVerificationFailure, + onCardEntryCancel, onGooglePayRequestNonceSuccess, onGooglePayRequestNonceFailure, onGooglePayCanceled, diff --git a/react-native-in-app-payments-quickstart/ios/Podfile.lock b/react-native-in-app-payments-quickstart/ios/Podfile.lock index 6039a566..fb4abb08 100644 --- a/react-native-in-app-payments-quickstart/ios/Podfile.lock +++ b/react-native-in-app-payments-quickstart/ios/Podfile.lock @@ -1406,61 +1406,61 @@ SPEC CHECKSUMS: fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 hermes-engine: 16b8530de1b383cdada1476cf52d1b52f0692cbc - RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 - RCTDeprecation: 4dc9c8fbcb15bc9e8f3cfa601ddc190e120f099b + RCT-Folly: 5dc73daec3476616d19e8a53f0156176f7b55461 + RCTDeprecation: efb313d8126259e9294dc4ee0002f44a6f676aba RCTRequired: f49ea29cece52aee20db633ae7edc4b271435562 RCTTypeSafety: a11979ff0570d230d74de9f604f7d19692157bc4 React: 88794fad7f460349dbc9df8a274d95f37a009f5d React-callinvoker: 7a7023e34a55c89ea2aa62486bb3c1164ab0be0c - React-Codegen: a4607fed8fd7185b9ac212c1e631fe0854e234c3 - React-Core: 60075333bc22b5a793d3f62e207368b79bff2e64 - React-CoreModules: 147c314d6b3b1e069c9ad64cbbbeba604854ff86 - React-cxxreact: 5de27fd8bff4764acb2eac3ee66001e0e2b910e7 + React-Codegen: 4f57111156f9ad04b02cde1b22814883f7fb3304 + React-Core: 74cc07109071b230de904d394c2bf15b9f886bff + React-CoreModules: 8beb4863375aafeac52c49a3962b81d137577585 + React-cxxreact: d0b0d575214ba236dff569e14dd4411ac82b3566 React-debug: 3d88e9b63330a2460377eafcfc94f68c791bba67 - React-Fabric: ef286f7f6fa4958e44793e002ca15473425b37e6 - React-FabricImage: c0554a6af432d06332be7b291a62d3832be65e98 + React-Fabric: 570817b118cefa001b00da811c82f04b4918ab58 + React-FabricImage: f630c1a1b6e22ef6db5af5008cb51949a7fec19c React-featureflags: df181841fe84a8f661df764838cb028cef3910b7 - React-graphics: 4fe219afa8fdeba3a79c50fb01cebd98c87a19c8 - React-hermes: d93936b02de2fd7e67c11e92c16d4278a14d0134 - React-ImageManager: 1d17717952083b760b5c44c55f8e42313d8647b6 - React-jserrorhandler: 973a6035b761b1bdf730762843e47b390f0d8086 - React-jsi: f46d09ee5079a4f3b637d30d0e59b8ea6470632c - React-jsiexecutor: e73579560957aa3ca9dc02ab90e163454279d48c - React-jsinspector: 42273c87f84c5a6ffccdcad759f4659a616bb582 - React-jsitracing: 3de522f8f794dccd3c54af9160dc992ee65bd494 - React-logger: 7e7403a2b14c97f847d90763af76b84b152b6fce - React-Mapbuffer: c5844bf3c2206f5475c0fc2340a89b049ea23c97 + React-graphics: a1d1e26dc3b1bb53c3e270c61637e7be8d44d0f8 + React-hermes: 06e8316213d56ab914afb9a829763123fcfacf22 + React-ImageManager: 03260cdbe588ae355731e9cf1d693454ac490d3c + React-jserrorhandler: 17a7f69981acda0c583c7ee5376b4c992bb78d28 + React-jsi: e381545475da5ea77777e7b5513031a434ced04b + React-jsiexecutor: ce91dde1a61efd519a5ff7ac0f64b61a14217072 + React-jsinspector: a43ed1760d1c4aaef2e92ec2812bc89a64f82419 + React-jsitracing: 1bcd20f3cf8b1affd9df3a0ef65d6c49af53e649 + React-logger: 6070f362a1657bb53335eb1fc903d3f49fd79842 + React-Mapbuffer: f2f600ccb3d8ef825c3ba28527aecd8e2a230d6e React-nativeconfig: 21d89c65ca39875fad2c5c465e0e013e514eba21 - React-NativeModulesApple: e2e180dae4486b2978fcf3564cc4c8de4b453a68 + React-NativeModulesApple: ad4469f7033251f459f0cef1b138bd15822b51f2 React-perflogger: 3d31e0d1e8ad891e43a09ac70b7b17a79773003a React-RCTActionSheet: c4a3a134f3434c9d7b0c1054f1a8cfed30c7a093 - React-RCTAnimation: 0e5d15320eeece667fcceb6c785acf9a184e9da1 - React-RCTAppDelegate: c4f6c0700b8950a8b18c2e004996eec1807d430a - React-RCTBlob: c46aaaee693d371a1c7cae2a8c8ee2aa7fbc1adb - React-RCTFabric: 1a4416c3b4e775b30049fca6174bbb3fe189c138 - React-RCTImage: a04dba5fcc823244f5822192c130ecf09623a57f - React-RCTLinking: 533bf13c745fcb2a0c14e0e49fd149586a7f0d14 - React-RCTNetwork: a29e371e0d363d7b4c10ab907bc4d6ae610541e9 - React-RCTSettings: 127813224780861d0d30ecda17a40d1dfebe7d73 - React-RCTText: 8a823f245ecf82edb7569646e3c4d8041deb800a - React-RCTVibration: 46b5fae74e63f240f22f39de16ad6433da3b65d9 - React-rendererdebug: fec09d89613086791afb57a741bda8716c5ff4dd + React-RCTAnimation: dab04683056694845eb7a9e283f4c63eec7fa633 + React-RCTAppDelegate: 1785d42459138c45175b2fa18e86cd2aee829a93 + React-RCTBlob: a0a8f6bfd8926bff0e2814ec3f8cd5514f2db243 + React-RCTFabric: a325737fec3fae059c46494b34af89b06ebe143c + React-RCTImage: 51db983bcc5075fa9bf3e094e5c6c1f5b5575472 + React-RCTLinking: 3430cd1023a5ac86a96ed6d4fbf7a8ed7b2e44d5 + React-RCTNetwork: 52198f8a8c823639dcc8f6725ca5b360d66ea1a0 + React-RCTSettings: c127440c2c538128f92fb45524e976e25cb69bd6 + React-RCTText: 640b2d0bfb51d88d8a76c6a1a7ea1f94667bf231 + React-RCTVibration: bd20c8156b649cd745c70db3341c409ae3b42821 + React-rendererdebug: 553eb12bb29e429fdbd4890675e0919f9cdcc7ab React-rncore: 9c134c48554a6d8d4c8d561d929a2018e8de71f9 - React-RuntimeApple: e36b278668707bd7fed473ff9d3620124e6f40e5 - React-RuntimeCore: 66d48e7a7bdea2481f1d6351173b991ac6bd72fb + React-RuntimeApple: d4c6b9b8584e42632e269fcd8e0c8f0eed5c8275 + React-RuntimeCore: 34ac8a9f036e4a7d610982583796e83aaabec551 React-runtimeexecutor: a278d4249921853d4a3f24e4d6e0ff30688f3c16 - React-RuntimeHermes: 927011fec9502e4823113ef8957056c3f151b29a - React-runtimescheduler: 86b9c5bccd239d91da33e08b4c58c6a40b7fdb48 - React-utils: 8e9c5cd66f0788e156a1fcb5cd69593ec8607611 - ReactCommon: eb4c4a9c43fcc0d93f922d0fdada24638429e515 - RNGestureHandler: 20a4307fd21cbff339abfcfa68192f3f0a6a518b - RNReanimated: 82d44098f1640ac390d073bca26264d52a67dc7d - RNSquareInAppPayments: 69e4c6d6be92bc7f94cca947fc91264dc8f8343b + React-RuntimeHermes: 5f80501a3de5dfeb62918623a0d62c67a0b963fc + React-runtimescheduler: 39c4921a6872b040affeee670efa0b723342f3b9 + React-utils: d85d8c48941f39f50a58c850e46cf03d7558142e + ReactCommon: 1064306a615792c5447b4801fafc57c4cac6d385 + RNGestureHandler: 5d95b0a3cffed8325ed0c181f4f411c1dcd49317 + RNReanimated: 0360fc3e49eed2ee7c42b36a6a36f0e2adb5f114 + RNSquareInAppPayments: 4f88784516fec07b025feb6c132baf317afc6096 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d SquareBuyerVerificationSDK: d325f473a724cfa5684a837296a307152ca52854 SquareInAppPaymentsSDK: 4d7f1e984fee5d8d7dbd44a67661ca1aedee7f76 - Yoga: d02ee88821190d82b2daa5cd15640a82ffafaaab + Yoga: dafebc41bc66910af33077aaa41078e89fd635bf -PODFILE CHECKSUM: 8e50b50321948545185a17fca0b0c0ce3a4f1cae +PODFILE CHECKSUM: 640c06f74b11404643bc327ffdcb1249ea42875e -COCOAPODS: 1.11.3 +COCOAPODS: 1.16.2 diff --git a/react-native-in-app-payments-quickstart/ios/RNInAppPaymentsQuickstart.xcodeproj/project.pbxproj b/react-native-in-app-payments-quickstart/ios/RNInAppPaymentsQuickstart.xcodeproj/project.pbxproj index 56a3858d..fc064f3e 100644 --- a/react-native-in-app-payments-quickstart/ios/RNInAppPaymentsQuickstart.xcodeproj/project.pbxproj +++ b/react-native-in-app-payments-quickstart/ios/RNInAppPaymentsQuickstart.xcodeproj/project.pbxproj @@ -10,12 +10,12 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 26CD38EF57C689068815F469 /* Pods_RNInAppPaymentsQuickstart.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BB663604904CCC767C9AE3DE /* Pods_RNInAppPaymentsQuickstart.framework */; }; 3374A13B269408843FD7A96A /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 54C0997F197CAB5980784EC7 /* PrivacyInfo.xcprivacy */; }; 59F1AC18231992AF00621E95 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59F1ABF1231992AF00621E95 /* JavaScriptCore.framework */; }; 8CA4A31A2BFDF8B3003FB39E /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8CA4A3192BFDF8B3003FB39E /* AppDelegate.mm */; }; 8CD213032BFF804E00599581 /* SquareInAppPaymentsSDK.framework in Resources */ = {isa = PBXBuildFile; fileRef = 8CD0B5102BFF1999008E3251 /* SquareInAppPaymentsSDK.framework */; }; 8CD48A742C04F77B00976978 /* SquareInAppPaymentsSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C2496382C04A06B00F27BC9 /* SquareInAppPaymentsSDK.xcframework */; }; - AA147E4AF2AF391A39B0BC38 /* Pods_RNInAppPaymentsQuickstart.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6561D0AC31E91D634DEC5C49 /* Pods_RNInAppPaymentsQuickstart.framework */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -32,6 +32,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 07F1A38933F3B6D749D4FA41 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNInAppPaymentsQuickstart.debug.xcconfig"; path = "Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart.debug.xcconfig"; sourceTree = ""; }; 11AC1A18220384F600928799 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/LaunchScreen.strings; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* RNInAppPaymentsQuickstart.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RNInAppPaymentsQuickstart.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNInAppPaymentsQuickstart/AppDelegate.h; sourceTree = ""; }; @@ -42,13 +43,12 @@ 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 54C0997F197CAB5980784EC7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = RNInAppPaymentsQuickstart/PrivacyInfo.xcprivacy; sourceTree = ""; }; 59F1ABF1231992AF00621E95 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; - 610FCFFB76AF32F6B0766BAB /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNInAppPaymentsQuickstart.release.xcconfig"; path = "Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart.release.xcconfig"; sourceTree = ""; }; - 6561D0AC31E91D634DEC5C49 /* Pods_RNInAppPaymentsQuickstart.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNInAppPaymentsQuickstart.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 8C2496382C04A06B00F27BC9 /* SquareInAppPaymentsSDK.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = SquareInAppPaymentsSDK.xcframework; path = Pods/SquareInAppPaymentsSDK/XCFrameworks/SquareInAppPaymentsSDK.xcframework; sourceTree = ""; }; 8C24963A2C04A07A00F27BC9 /* libRNSquareInAppPayments.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libRNSquareInAppPayments.a; sourceTree = BUILT_PRODUCTS_DIR; }; 8CA4A3192BFDF8B3003FB39E /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNInAppPaymentsQuickstart/AppDelegate.mm; sourceTree = ""; }; 8CD0B5102BFF1999008E3251 /* SquareInAppPaymentsSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SquareInAppPaymentsSDK.framework; sourceTree = ""; }; - 9366025E6D82E1C7C7E4FAF9 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNInAppPaymentsQuickstart.debug.xcconfig"; path = "Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart.debug.xcconfig"; sourceTree = ""; }; + 90E6801C034B38B9A79598E3 /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNInAppPaymentsQuickstart.release.xcconfig"; path = "Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart.release.xcconfig"; sourceTree = ""; }; + BB663604904CCC767C9AE3DE /* Pods_RNInAppPaymentsQuickstart.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNInAppPaymentsQuickstart.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -58,7 +58,7 @@ files = ( 8CD48A742C04F77B00976978 /* SquareInAppPaymentsSDK.xcframework in Frameworks */, 59F1AC18231992AF00621E95 /* JavaScriptCore.framework in Frameworks */, - AA147E4AF2AF391A39B0BC38 /* Pods_RNInAppPaymentsQuickstart.framework in Frameworks */, + 26CD38EF57C689068815F469 /* Pods_RNInAppPaymentsQuickstart.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -93,7 +93,7 @@ 8C2496382C04A06B00F27BC9 /* SquareInAppPaymentsSDK.xcframework */, 59F1ABF1231992AF00621E95 /* JavaScriptCore.framework */, 2D16E6891FA4F8E400B85C8A /* libReact.a */, - 6561D0AC31E91D634DEC5C49 /* Pods_RNInAppPaymentsQuickstart.framework */, + BB663604904CCC767C9AE3DE /* Pods_RNInAppPaymentsQuickstart.framework */, ); name = Frameworks; sourceTree = ""; @@ -101,8 +101,8 @@ 6D894E683995D6240DDD9A38 /* Pods */ = { isa = PBXGroup; children = ( - 9366025E6D82E1C7C7E4FAF9 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */, - 610FCFFB76AF32F6B0766BAB /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */, + 07F1A38933F3B6D749D4FA41 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */, + 90E6801C034B38B9A79598E3 /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -145,14 +145,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNInAppPaymentsQuickstart" */; buildPhases = ( - 12936A94188DF7CEC86504F2 /* [CP] Check Pods Manifest.lock */, + 90B16F724DA8E740AFB16BC8 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 110233C721F10681008F6C3D /* Embed Frameworks */, - 4574BDB937B7D93FB3DBACE8 /* [CP] Embed Pods Frameworks */, - 54553DFF54BD7138AACCB48D /* [CP] Copy Pods Resources */, + 1C56C1F0A41A7D307C1A34EA /* [CP] Embed Pods Frameworks */, + 2C526E006E09C03637522763 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -231,33 +231,11 @@ shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; }; - 12936A94188DF7CEC86504F2 /* [CP] Check Pods Manifest.lock */ = { + 1C56C1F0A41A7D307C1A34EA /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RNInAppPaymentsQuickstart-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 4574BDB937B7D93FB3DBACE8 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 12; - files = ( - ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart-frameworks.sh", "${PODS_XCFRAMEWORKS_BUILD_DIR}/SquareBuyerVerificationSDK/SquareBuyerVerificationSDK.framework/SquareBuyerVerificationSDK", @@ -273,10 +251,10 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - 54553DFF54BD7138AACCB48D /* [CP] Copy Pods Resources */ = { + 2C526E006E09C03637522763 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -295,6 +273,28 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNInAppPaymentsQuickstart/Pods-RNInAppPaymentsQuickstart-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 90B16F724DA8E740AFB16BC8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RNInAppPaymentsQuickstart-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -325,12 +325,16 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9366025E6D82E1C7C7E4FAF9 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */; + baseConfigurationReference = 07F1A38933F3B6D749D4FA41 /* Pods-RNInAppPaymentsQuickstart.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; DEAD_CODE_STRIPPING = NO; DEVELOPMENT_TEAM = ""; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; + EXPANDED_CODE_SIGN_IDENTITY = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -359,11 +363,15 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 610FCFFB76AF32F6B0766BAB /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */; + baseConfigurationReference = 90E6801C034B38B9A79598E3 /* Pods-RNInAppPaymentsQuickstart.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = ""; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; + EXPANDED_CODE_SIGN_IDENTITY = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", @@ -424,7 +432,8 @@ CXX = ""; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; + "EXCLUDED_ARCHS[sdk=iphone*]" = arm64; + "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -456,7 +465,10 @@ LDPLUSPLUS = ""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; @@ -521,7 +533,10 @@ LD = ""; LDPLUSPLUS = ""; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/react-native-in-app-payments-quickstart/yarn.lock b/react-native-in-app-payments-quickstart/yarn.lock index bec954e3..492e9c45 100644 --- a/react-native-in-app-payments-quickstart/yarn.lock +++ b/react-native-in-app-payments-quickstart/yarn.lock @@ -5796,7 +5796,7 @@ react-native-safe-area-view@^0.14.9: hoist-non-react-statics "^2.3.1" "react-native-square-in-app-payments@file:..": - version "1.7.5" + version "1.7.6" react-native@0.74.1: version "0.74.1" diff --git a/src/ApplePay.ts b/src/ApplePay.ts index 93eb70ef..799f0bf9 100644 --- a/src/ApplePay.ts +++ b/src/ApplePay.ts @@ -22,6 +22,9 @@ import FailureCallback from './models/FailureCallback'; import NonceSuccessCallback from './models/NonceSuccessCallback'; import PaymentType from './models/PaymentType'; import Utilities from './Utilities'; +import CardEntryConfig from './models/CardEntryConfig'; +import BuyerVerificationSuccessCallback from './models/BuyerVerificationSuccessCallback'; +import VerificationResult from './models/VerificationResult'; // const PaymentTypePending = 1; // const PaymentTypeFinal = 2; @@ -42,10 +45,31 @@ const onNativeApplePayComplete = () => { if (applePayCompleteCallback) applePayCompleteCallback(); }; +let cardEntryCancelCallback: () => void; +const onNativeCardEntryCanceled = () => { + if (cardEntryCancelCallback) cardEntryCancelCallback(); +}; + +let buyerVerificationSuccessCallback:{ (verificationResult:VerificationResult) : void; }; +const onNativeBuyerVerificationSuccess = (verificationResult:VerificationResult) => { + if (buyerVerificationSuccessCallback) { + buyerVerificationSuccessCallback(verificationResult); + } +}; + +let buyerVerificationErrorCallback:{ (error:ErrorDetails) : void; }; +const onNativeBuyerVerificationError = (error:ErrorDetails) => { + if (buyerVerificationErrorCallback) { + buyerVerificationErrorCallback(error); + } +}; + const applePayEmitter = new NativeEventEmitter(RNSQIPApplePay); applePayEmitter.addListener('onApplePayNonceRequestSuccess', onNativeApplePayNonceRequestSuccess); applePayEmitter.addListener('onApplePayNonceRequestFailure', onNativeApplePayNonceRequestFailure); applePayEmitter.addListener('onApplePayComplete', onNativeApplePayComplete); +applePayEmitter.addListener('onBuyerVerificationSuccessFromApplePay', onNativeBuyerVerificationSuccess); +applePayEmitter.addListener('onBuyerVerificationErrorFromApplePay', onNativeBuyerVerificationError); const initializeApplePay = async (applePayMerchantId:string) => { Utilities.verifyStringType(applePayMerchantId, 'applePayMerchantId should be a string'); @@ -90,6 +114,71 @@ const requestApplePayNonce = async ( } }; +const requestApplePayNonceWithBuyerVerification = async ( + paymentSourceId:string, + cardEntryConfig:CardEntryConfig, + applePayConfig:ApplePayConfig, + onBuyerVerificationSuccess:BuyerVerificationSuccessCallback, + onBuyerVerificationFailure:FailureCallback, + onCardEntryCancel:CancelAndCompleteCallback, + onApplePayNonceRequestSuccess:NonceSuccessCallback, + onApplePayNonceRequestFailure:FailureCallback, + onApplePayComplete:CancelAndCompleteCallback, +) => { + Utilities.verifyObjectType(applePayConfig, 'applePayConfig should be a valid object'); + Utilities.verifyStringType(applePayConfig.price, 'applePayConfig.price should be a valid string'); + Utilities.verifyStringType(applePayConfig.summaryLabel, 'applePayConfig.summaryLabel should be a valid string'); + Utilities.verifyStringType(applePayConfig.countryCode, 'applePayConfig.countryCode should be a valid string'); + Utilities.verifyStringType(applePayConfig.currencyCode, 'applePayConfig.currencyCode should be a valid string'); + + let { paymentType } = applePayConfig; + if (!applePayConfig.paymentType) { + paymentType = PaymentType.PaymentTypeFinal; + } else { + Utilities.verifyIntegerType(applePayConfig.paymentType, 'applePayConfig.paymentType should be a valid integer'); + } + + const money = { + amount: cardEntryConfig.amount, + currencyCode: cardEntryConfig.currencyCode, + }; + const contact = { + givenName: cardEntryConfig.givenName, + familyName: cardEntryConfig.familyName, + addressLines: cardEntryConfig.addressLines, + city: cardEntryConfig.city, + countryCode: cardEntryConfig.countryCode, + email: cardEntryConfig.email, + phone: cardEntryConfig.phone, + postalCode: cardEntryConfig.postalCode, + region: cardEntryConfig.region, + }; + + buyerVerificationSuccessCallback = onBuyerVerificationSuccess; + buyerVerificationErrorCallback = onBuyerVerificationFailure; + cardEntryCancelCallback = onCardEntryCancel; + applePayNonceRequestSuccessCallback = onApplePayNonceRequestSuccess; + applePayNonceRequestFailureCallback = onApplePayNonceRequestFailure; + applePayCompleteCallback = onApplePayComplete; + + try { + await RNSQIPApplePay.requestApplePayNonceWithVerification( + paymentSourceId, + cardEntryConfig.squareLocationId, + cardEntryConfig.buyerAction, + money, + contact, + applePayConfig.price, + applePayConfig.summaryLabel, + applePayConfig.countryCode, + applePayConfig.currencyCode, + paymentType, + ); + } catch (ex) { + throw Utilities.createInAppPayementsError(ex); + } +} + const completeApplePayAuthorization = async (isSuccess:boolean, errorMessage = '') => { Utilities.verifyBooleanType(isSuccess, 'isSuccess should be a valid boolean'); Utilities.verifyStringType(errorMessage, 'errorMessage should be a valid string'); @@ -101,5 +190,6 @@ export default { initializeApplePay, canUseApplePay, requestApplePayNonce, - completeApplePayAuthorization, + requestApplePayNonceWithBuyerVerification, + completeApplePayAuthorization }; diff --git a/src/CardEntry.ts b/src/CardEntry.ts index ccc88e9c..a064bed1 100644 --- a/src/CardEntry.ts +++ b/src/CardEntry.ts @@ -25,7 +25,7 @@ import VerificationResult from './models/VerificationResult'; import Utilities from './Utilities'; import ThemeType from './models/ThemeType'; -const { RNSQIPCardEntry } = NativeModules; +const { RNSQIPCardEntry, RNSQIPApplePay } = NativeModules; let cardEntryCancelCallback: () => void; const onNativeCardEntryCanceled = () => { @@ -59,6 +59,7 @@ const onNativeBuyerVerificationError = (error:ErrorDetails) => { }; const cardEntryEmitter = new NativeEventEmitter(RNSQIPCardEntry); + cardEntryEmitter.addListener('cardEntryCancel', onNativeCardEntryCanceled); cardEntryEmitter.addListener('cardEntryDidObtainCardDetails', onNativeCardEntryDidObtainCardDetails); cardEntryEmitter.addListener('cardEntryComplete', onNativeCardEntryComplete); @@ -114,10 +115,14 @@ const startBuyerVerificationFlow = async (paymentSourceId:string, ); }; -const startCardEntryFlowWithBuyerVerification = async (cardEntryConfig:CardEntryConfig, +const startCardEntryFlowWithBuyerVerification = async ( + cardEntryConfig:CardEntryConfig, + paymentSourceId:string, onBuyerVerificationSuccess:BuyerVerificationSuccessCallback, onBuyerVerificationFailure:FailureCallback, - onCardEntryCancel:CancelAndCompleteCallback) => { + onCardNonceRequestSuccess:NonceSuccessCallback, + onCardEntryCancel:CancelAndCompleteCallback +) => { let cardEntryInternalConfig : CardEntryConfig = { collectPostalCode: true }; if (cardEntryConfig) { Utilities.verifyObjectType(cardEntryConfig, 'cardEntryConfig should be an object.'); @@ -130,29 +135,34 @@ const startCardEntryFlowWithBuyerVerification = async (cardEntryConfig:CardEntry cardEntryInternalConfig.collectPostalCode = true; } - const { squareLocationId } = cardEntryConfig; - const { buyerAction } = cardEntryConfig; const money = { - amount: cardEntryConfig.amount, - currencyCode: cardEntryConfig.currencyCode, + amount: cardEntryInternalConfig.amount, + currencyCode: cardEntryInternalConfig.currencyCode, }; const contact = { - givenName: cardEntryConfig.givenName, - familyName: cardEntryConfig.familyName, - addressLines: cardEntryConfig.addressLines, - city: cardEntryConfig.city, - countryCode: cardEntryConfig.countryCode, - email: cardEntryConfig.email, - phone: cardEntryConfig.phone, - postalCode: cardEntryConfig.postalCode, - region: cardEntryConfig.region, + givenName: cardEntryInternalConfig.givenName, + familyName: cardEntryInternalConfig.familyName, + addressLines: cardEntryInternalConfig.addressLines, + city: cardEntryInternalConfig.city, + countryCode: cardEntryInternalConfig.countryCode, + email: cardEntryInternalConfig.email, + phone: cardEntryInternalConfig.phone, + postalCode: cardEntryInternalConfig.postalCode, + region: cardEntryInternalConfig.region, }; buyerVerificationSuccessCallback = onBuyerVerificationSuccess; buyerVerificationErrorCallback = onBuyerVerificationFailure; + cardEntryCardNonceRequestSuccessCallback = onCardNonceRequestSuccess; cardEntryCancelCallback = onCardEntryCancel; + await RNSQIPCardEntry.startCardEntryFlowWithVerification( - cardEntryInternalConfig.collectPostalCode, squareLocationId, buyerAction, money, contact, + paymentSourceId, + cardEntryInternalConfig.squareLocationId, + cardEntryInternalConfig.buyerAction, + cardEntryInternalConfig.collectPostalCode, + money, + contact, ); }; @@ -163,6 +173,44 @@ const startGiftCardEntryFlow = async (onCardNonceRequestSuccess:NonceSuccessCall await RNSQIPCardEntry.startGiftCardEntryFlow(); }; +const startGiftCardEntryFlowWithBuyerVerification = async ( + paymentSourceId:string, + cardEntryConfig:CardEntryConfig, + onBuyerVerificationSuccess:BuyerVerificationSuccessCallback, + onBuyerVerificationFailure:FailureCallback, + onCardEntryCancel:CancelAndCompleteCallback, + onCardNonceRequestSuccess:NonceSuccessCallback, +) => { + cardEntryCardNonceRequestSuccessCallback = onCardNonceRequestSuccess; + cardEntryCancelCallback = onCardEntryCancel; + buyerVerificationSuccessCallback = onBuyerVerificationSuccess; + buyerVerificationErrorCallback = onBuyerVerificationFailure; + + const money = { + amount: cardEntryConfig.amount, + currencyCode: cardEntryConfig.currencyCode, + }; + const contact = { + givenName: cardEntryConfig.givenName, + familyName: cardEntryConfig.familyName, + addressLines: cardEntryConfig.addressLines, + city: cardEntryConfig.city, + countryCode: cardEntryConfig.countryCode, + email: cardEntryConfig.email, + phone: cardEntryConfig.phone, + postalCode: cardEntryConfig.postalCode, + region: cardEntryConfig.region, + }; + + await RNSQIPCardEntry.startGiftCardEntryFlowWithVerification( + paymentSourceId, + cardEntryConfig.squareLocationId, + cardEntryConfig.buyerAction, + money, + contact + ); +}; + const completeCardEntry = async (onCardEntryComplete:CancelAndCompleteCallback) => { cardEntryCompleteCallback = onCardEntryComplete; await RNSQIPCardEntry.completeCardEntry(); @@ -176,11 +224,13 @@ const showCardNonceProcessingError = async (errorMessage:string) => { const setIOSCardEntryTheme = async (theme:ThemeType) => { Utilities.verifyThemeType(theme); await RNSQIPCardEntry.setTheme(theme); + await RNSQIPApplePay.setTheme(theme); }; export default Platform.select({ ios: { startGiftCardEntryFlow, + startGiftCardEntryFlowWithBuyerVerification, startCardEntryFlow, startCardEntryFlowWithBuyerVerification, completeCardEntry, @@ -190,6 +240,7 @@ export default Platform.select({ }, android: { startGiftCardEntryFlow, + startGiftCardEntryFlowWithBuyerVerification, startCardEntryFlow, startCardEntryFlowWithBuyerVerification, completeCardEntry, diff --git a/src/GooglePay.ts b/src/GooglePay.ts index ab4e5818..9abda60f 100644 --- a/src/GooglePay.ts +++ b/src/GooglePay.ts @@ -21,9 +21,31 @@ import FailureCallback from './models/FailureCallback'; import GooglePayConfig from './models/GooglePayConfig'; import NonceSuccessCallback from './models/NonceSuccessCallback'; import Utilities from './Utilities'; +import BuyerVerificationSuccessCallback from './models/BuyerVerificationSuccessCallback'; +import CardEntryConfig from './models/CardEntryConfig'; +import VerificationResult from './models/VerificationResult'; const { RNSQIPGooglePay } = NativeModules; +let cardEntryCancelCallback: () => void; +const onNativeCardEntryCanceled = () => { + if (cardEntryCancelCallback) cardEntryCancelCallback(); +}; + +let buyerVerificationSuccessCallback:{ (verificationResult:VerificationResult) : void; }; +const onNativeBuyerVerificationSuccess = (verificationResult:VerificationResult) => { + if (buyerVerificationSuccessCallback) { + buyerVerificationSuccessCallback(verificationResult); + } +}; + +let buyerVerificationErrorCallback:{ (error:ErrorDetails) : void; }; +const onNativeBuyerVerificationError = (error:ErrorDetails) => { + if (buyerVerificationErrorCallback) { + buyerVerificationErrorCallback(error); + } +}; + let googlePayNonceRequestSuccessCallback: { (cardDetails:CardDetails) : void; }; const onNativeGooglePayNonceRequestSuccess = (cardDetails:CardDetails) => { if (googlePayNonceRequestSuccessCallback) googlePayNonceRequestSuccessCallback(cardDetails); @@ -44,6 +66,9 @@ if (Platform.OS === 'android') { googlePayEmitter.addListener('onGooglePayNonceRequestSuccess', onNativeGooglePayNonceRequestSuccess); googlePayEmitter.addListener('onGooglePayNonceRequestFailure', onNativeGooglePayNonceRequestFailure); googlePayEmitter.addListener('onGooglePayCanceled', onNativeGooglePayCanceled); + googlePayEmitter.addListener('onBuyerVerificationSuccessFromGooglePay', onNativeBuyerVerificationSuccess); + googlePayEmitter.addListener('onBuyerVerificationErrorFromGooglePay', onNativeBuyerVerificationError); + googlePayEmitter.addListener('cardEntryCancelFromGooglePay', onNativeCardEntryCanceled); } const initializeGooglePay = async (squareLocationId:string, environment:number) => { @@ -88,6 +113,61 @@ const requestGooglePayNonce = async ( } }; +const requestGooglePayNonceWithBuyerVerification = async ( + paymentSourceId:string, + cardEntryConfig:CardEntryConfig, + googlePayConfig:GooglePayConfig, + onBuyerVerificationSuccess:BuyerVerificationSuccessCallback, + onBuyerVerificationFailure:FailureCallback, + onCardEntryCancel:CancelAndCompleteCallback, + onGooglePayNonceRequestSuccess:NonceSuccessCallback, + onGooglePayNonceRequestFailure:FailureCallback, + onGooglePayCanceled:CancelAndCompleteCallback, +) => { + Utilities.verifyObjectType(googlePayConfig, 'googlePayConfig should be a valid object'); + Utilities.verifyStringType(googlePayConfig.price, 'googlePayConfig.price should be a valid string'); + Utilities.verifyStringType(googlePayConfig.currencyCode, 'googlePayConfig.currencyCode should be a valid string'); + Utilities.verifyIntegerType(googlePayConfig.priceStatus, 'googlePayConfig.priceStatus should be a valid integer'); + + googlePayNonceRequestSuccessCallback = onGooglePayNonceRequestSuccess; + googlePayNonceRequestFailureCallback = onGooglePayNonceRequestFailure; + googlePayCancelCallback = onGooglePayCanceled; + buyerVerificationSuccessCallback = onBuyerVerificationSuccess; + buyerVerificationErrorCallback = onBuyerVerificationFailure; + cardEntryCancelCallback = onCardEntryCancel; + + const money = { + amount: cardEntryConfig.amount, + currencyCode: cardEntryConfig.currencyCode, + }; + const contact = { + givenName: cardEntryConfig.givenName, + familyName: cardEntryConfig.familyName, + addressLines: cardEntryConfig.addressLines, + city: cardEntryConfig.city, + countryCode: cardEntryConfig.countryCode, + email: cardEntryConfig.email, + phone: cardEntryConfig.phone, + postalCode: cardEntryConfig.postalCode, + region: cardEntryConfig.region, + }; + + try { + await RNSQIPGooglePay.requestGooglePayNonceWithVerification( + paymentSourceId, + cardEntryConfig.squareLocationId, + cardEntryConfig.buyerAction, + money, + contact, + googlePayConfig.price, + googlePayConfig.currencyCode, + googlePayConfig.priceStatus, + ); + } catch (ex) { + throw Utilities.createInAppPayementsError(ex); + } +}; + const TotalPriceStatusNotCurrentlyKnown = 1; const TotalPriceStatusEstimated = 2; const TotalPriceStatusFinal = 3; @@ -99,6 +179,7 @@ export default { initializeGooglePay, canUseGooglePay, requestGooglePayNonce, + requestGooglePayNonceWithBuyerVerification, TotalPriceStatusNotCurrentlyKnown, TotalPriceStatusEstimated, TotalPriceStatusFinal, diff --git a/yarn.lock b/yarn.lock index 71a5a4df..4750e1a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2270,6 +2270,14 @@ invariant "^2.2.4" nullthrows "^1.1.1" +"@react-native/virtualized-lists@^0.72.4": + version "0.72.8" + resolved "https://registry.yarnpkg.com/@react-native/virtualized-lists/-/virtualized-lists-0.72.8.tgz#a2c6a91ea0f1d40eb5a122fb063daedb92ed1dc3" + integrity sha512-J3Q4Bkuo99k7mu+jPS9gSUSgq+lLRSI/+ahXNwV92XgJ/8UgOTxu2LPwhJnBk/sQKxq7E8WkZBnBiozukQMqrw== + dependencies: + invariant "^2.2.4" + nullthrows "^1.1.1" + "@rnx-kit/chromium-edge-launcher@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@rnx-kit/chromium-edge-launcher/-/chromium-edge-launcher-1.0.0.tgz#c0df8ea00a902c7a417cd9655aab06de398b939c" @@ -2471,21 +2479,22 @@ resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== -"@types/react-native@^0.64.10": - version "0.64.10" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.64.10.tgz#5eb6a72c77ce0f7e6e14b19c61a6bc585975eef5" - integrity sha512-3Kb9QM5/WZ6p58yZ7VPbvjvi6Wc/ZkESgJhKso1gKkNuHBe/4WL6586R2JRDiz9Tsxal9lMnbj3fligBVGl8PA== +"@types/react-native@^0.72.0": + version "0.72.8" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.72.8.tgz#eb6238fab289f5f132f7ccf138bdfe6f21ed93e1" + integrity sha512-St6xA7+EoHN5mEYfdWnfYt0e8u6k2FR0P9s2arYgakQGFgU1f9FlPrIEcj0X24pLCF5c5i3WVuLCUdiCYHmOoA== dependencies: + "@react-native/virtualized-lists" "^0.72.4" "@types/react" "*" -"@types/react-test-renderer@^17.0.1": - version "17.0.1" - resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-17.0.1.tgz#3120f7d1c157fba9df0118dae20cb0297ee0e06b" - integrity sha512-3Fi2O6Zzq/f3QR9dRnlnHso9bMl7weKCviFmfF6B4LS1Uat6Hkm15k0ZAQuDz+UBq6B3+g+NM6IT2nr5QgPzCw== +"@types/react-test-renderer@^18.2.0": + version "18.3.1" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-18.3.1.tgz#225bfe8d4ad7ee3b04c2fa27642bb74274a5961d" + integrity sha512-vAhnk0tG2eGa37lkU9+s5SoroCsRI08xnsWFiAXOuPH2jqzMbcXvKExXViPi1P5fIklDeCvXqyrdmipFaSkZrA== dependencies: - "@types/react" "*" + "@types/react" "^18" -"@types/react@*", "@types/react@^17.0.11": +"@types/react@*": version "17.0.11" resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.11.tgz#67fcd0ddbf5a0b083a0f94e926c7d63f3b836451" integrity sha512-yFRQbD+whVonItSk7ZzP/L+gPTJVBkL/7shLEF+i9GC/1cV3JmUxEQz6+9ylhUpWSDuqo1N9qEvqS6vTj4USUA== @@ -2494,6 +2503,14 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^18", "@types/react@^18.2.6": + version "18.3.26" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.26.tgz#4c5970878d30db3d2a0bca1e4eb5f258e391bbeb" + integrity sha512-RFA/bURkcKzx/X9oumPG9Vp3D3JUgus/d0b67KB0t5S/raciymilkOa66olh78MUI92QLbEJevO7rvqU/kjwKA== + dependencies: + "@types/prop-types" "*" + csstype "^3.0.2" + "@types/scheduler@*": version "0.16.1" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" @@ -6481,7 +6498,7 @@ prompts@^2.4.2: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -6530,7 +6547,7 @@ react-devtools-core@^5.0.0: shell-quote "^1.6.1" ws "^7" -"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0: +"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0, react-is@^18.2.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== @@ -6540,11 +6557,6 @@ react-is@^16.8.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.9.0.tgz#21ca9561399aad0ff1a7701c01683e8ca981edcb" integrity sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw== -react-is@^16.9.0: - version "16.12.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" - integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== - react-is@^17.0.1: version "17.0.2" resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" @@ -6611,15 +6623,14 @@ react-shallow-renderer@^16.15.0: object-assign "^4.1.1" react-is "^16.12.0 || ^17.0.0 || ^18.0.0" -react-test-renderer@16.9.0: - version "16.9.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.9.0.tgz#7ed657a374af47af88f66f33a3ef99c9610c8ae9" - integrity sha512-R62stB73qZyhrJo7wmCW9jgl/07ai+YzvouvCXIJLBkRlRqLx4j9RqcLEAfNfU3OxTGucqR2Whmn3/Aad6L3hQ== +react-test-renderer@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.2.0.tgz#1dd912bd908ff26da5b9fca4fd1c489b9523d37e" + integrity sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA== dependencies: - object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.9.0" - scheduler "^0.15.0" + react-is "^18.2.0" + react-shallow-renderer "^16.15.0" + scheduler "^0.23.0" react@18.2.0: version "18.2.0" @@ -6912,13 +6923,12 @@ scheduler@0.24.0-canary-efb381bbf-20230505: dependencies: loose-envify "^1.1.0" -scheduler@^0.15.0: - version "0.15.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.15.0.tgz#6bfcf80ff850b280fed4aeecc6513bc0b4f17f8e" - integrity sha512-xAefmSfN6jqAa7Kuq7LIJY0bwAPG3xlCj0HMEBQk1lxYiDKZscY2xJ5U/61ZTrYbmNQbXa+gc7czPkVo11tnCg== +scheduler@^0.23.0: + version "0.23.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" selfsigned@^2.4.1: version "2.4.1"