From 5582c8fcc8904865b3d5d5dd2aee62a541ba0747 Mon Sep 17 00:00:00 2001 From: George Date: Tue, 6 Apr 2021 15:24:58 +0400 Subject: [PATCH] adding paypal control, fixing disable card option for android --- .../power/RNBraintreeDropIn/RNBraintreeDropInModule.java | 7 ++++++- ios/RNBraintreeDropIn.m | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java b/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java index e312e47..334dd59 100644 --- a/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java +++ b/android/src/main/java/tech/power/RNBraintreeDropIn/RNBraintreeDropInModule.java @@ -73,7 +73,12 @@ public void show(final ReadableMap options, final Promise promise) { .shippingAddressRequired(true).shippingAddressEditable(true); dropInRequest.paypalRequest(payPalPaymentRequest); } - if(options.hasKey("cardDisabled")) { + if(!options.getBoolean("payPal")){ + //disable paypal + dropInRequest.disablePayPal(); + } + + if(options.getBoolean("cardDisabled")) { dropInRequest.disableCard(); } if (options.hasKey("threeDSecure")) { diff --git a/ios/RNBraintreeDropIn.m b/ios/RNBraintreeDropIn.m index bbf82f1..5653db6 100644 --- a/ios/RNBraintreeDropIn.m +++ b/ios/RNBraintreeDropIn.m @@ -68,6 +68,10 @@ - (dispatch_queue_t)methodQueue request.vaultManager = YES; } + if(![options[@"payPal"] boolValue]){ //disable paypal + request.paypalDisabled = YES; + } + if([options[@"cardDisabled"] boolValue]){ request.cardDisabled = YES; }