react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

iOS TypeError: Cannot read property 'createPaymentRequest' of undefined

Open albeto8 opened this issue 6 years ago • 11 comments

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.

albeto8 avatar Dec 11 '18 22:12 albeto8

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.

albeto8 avatar Dec 11 '18 23:12 albeto8

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.

quachsimon avatar Mar 26 '19 19:03 quachsimon

+1

dachinat avatar Apr 03 '19 21:04 dachinat

Can this have some attention? 😞

dachinat avatar Apr 03 '19 21:04 dachinat

@albeto8 thanks... worked by manually linking ReactNativePayments in Xcode.

raman-sidhu avatar Aug 12 '19 13:08 raman-sidhu

this is terrible

henriquezago avatar Jan 08 '20 20:01 henriquezago

The manual linking doesn't work for me, now the build fails without any error messages.

henriquezago avatar Jan 08 '20 20:01 henriquezago

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)

davidsmorais avatar Feb 04 '20 12:02 davidsmorais

@dmorais92 @henriquezago did you solve the problem? ,

alex-mironov avatar Feb 20 '20 16:02 alex-mironov

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 😛

davidsmorais avatar Feb 21 '20 13:02 davidsmorais

thanks @dmorais92 :) I'm looking into tipsi-stripe right now instead of this.

alex-mironov avatar Feb 21 '20 13:02 alex-mironov