Coder Social home page Coder Social logo

Comments (2)

magrinj avatar magrinj commented on August 20, 2024 2

@mattgabriel You can use patch-package to patch the library and force this one to use Stripe ~> 21.4.0

Some extra changes need to be applied because Stripe is now in Swift.

diff --git a/node_modules/react-native-stripe-payments/ios/StripePayments.h b/node_modules/react-native-stripe-payments/ios/StripePayments.h
index f1d3301..322e3ec 100644
--- a/node_modules/react-native-stripe-payments/ios/StripePayments.h
+++ b/node_modules/react-native-stripe-payments/ios/StripePayments.h
@@ -1,6 +1,6 @@
 #import <Foundation/Foundation.h>
 #import <React/RCTBridgeModule.h>
-#import <Stripe/Stripe.h>
+@import Stripe;
 
 @interface StripePayments : NSObject<RCTBridgeModule, STPAuthenticationContext>
 
diff --git a/node_modules/react-native-stripe-payments/ios/StripePayments.m b/node_modules/react-native-stripe-payments/ios/StripePayments.m
index d0142c2..7261999 100644
--- a/node_modules/react-native-stripe-payments/ios/StripePayments.m
+++ b/node_modules/react-native-stripe-payments/ios/StripePayments.m
@@ -8,7 +8,7 @@ @implementation StripePayments
 
 RCT_EXPORT_METHOD(init:(NSString *)publishableKey)
 {
-    [Stripe setDefaultPublishableKey:publishableKey];
+    [StripeAPI setDefaultPublishableKey:publishableKey];
 }
 
 RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(isCardValid:(NSDictionary *)cardParams)
diff --git a/node_modules/react-native-stripe-payments/react-native-stripe-payments.podspec b/node_modules/react-native-stripe-payments/react-native-stripe-payments.podspec
index 2f2f6a3..7c9b694 100644
--- a/node_modules/react-native-stripe-payments/react-native-stripe-payments.podspec
+++ b/node_modules/react-native-stripe-payments/react-native-stripe-payments.podspec
@@ -19,6 +19,5 @@ Pod::Spec.new do |s|
   s.requires_arc = true
 
   s.dependency "React"
-  s.dependency "Stripe", "~> 19.0"
+  s.dependency "Stripe", "~> 21.4.0"
 end
-

• Create the famous "Dummy" swift file (xcode -> open your project -> right click on the folder named after your project, where Info.plist resides -> new File -> Swift -> say YES when asked for the bridging header)
• Remove the swift-5.0 search path, or you will get an error about undefined symbols (try it if you don't believe me), do this -> react-native-community/upgrade-support#62 (comment)

Ref: https://github.com/agaweb/react-native-stripe#additional-ios-setup

Everything should work after all of this !

from react-native-stripe-payments.

karimApps142 avatar karimApps142 commented on August 20, 2024

I m facing the same issue solved by updating the latest version of the stripe library

from react-native-stripe-payments.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.