react-native-payments
react-native-payments copied to clipboard
iOS TypeError: Cannot read property 'createPaymentRequest' of undefined
Right now when creating a paymentRequest instance like this:
const paymentRequest = new PaymentRequest(METHOD_DATA, DETAILS);
I get this warning message "TypeError: Cannot read property 'createPaymentRequest' of undefined" And I cannot use the show method, this happens me only in iOS
Android works fine.
Solved by manually linking ReactNativePayments.xcodeproj to Xcode. https://facebook.github.io/react-native/docs/linking-libraries-ios
I think the "react-native link react-native-payments" currently does not auto link to iOS project.
I scratched my head way too long on this one. @albeto8 suggestion works. What could be the reason why it isn't being linked to the iOS project right now when running the link command?
I am now getting an
Error: AbortError _closePaymentRequest
error now which solves this issue.
+1
Can this have some attention? 😞
@albeto8 thanks... worked by manually linking ReactNativePayments in Xcode.
this is terrible
The manual linking doesn't work for me, now the build fails without any error messages.
Same here, tried manual linking and now build fails. Here's the output:
The following build commands failed:
CompileC /Users/dmorais/dev/app-name/ios/build/AppName/Build/Intermediates.noindex/ReactNativePayments.build/Debug-iphonesimulator/ReactNativePayments.build/Objects-normal/x86_64/ReactNativePayments.o /Users/dmorais/dev/app-name/node_modules/react-native-payments/lib/ios/ReactNativePayments.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/dmorais/dev/app-name/ios/build/AppName/Build/Intermediates.noindex/ReactNativePayments.build/Debug-iphonesimulator/ReactNativePayments.build/Objects-normal/x86_64/PKPaymentButtonView.o /Users/dmorais/dev/app-name/node_modules/react-native-payments/lib/ios/Views/PKPaymentButtonView.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/dmorais/dev/app-name/ios/build/AppName/Build/Intermediates.noindex/ReactNativePayments.build/Debug-iphonesimulator/ReactNativePayments.build/Objects-normal/x86_64/PKPaymentButtonManager.o /Users/dmorais/dev/app-name/node_modules/react-native-payments/lib/ios/Views/PKPaymentButtonManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
@dmorais92 @henriquezago did you solve the problem? ,
Oh I solved the problem alright... Did not use this library and used 'react-native-apay' for Apple Pay and 'react-native-google-pay' for Android 😛
thanks @dmorais92 :) I'm looking into tipsi-stripe right now instead of this.