简体   繁体   English

expo 的条纹(反应原生)

[英]stripe for expo (react native)

I am working on a mobile app based on expo (react-native) and I need double check if the mobile device supports apple payment.我正在开发基于 expo (react-native) 的移动应用程序,我需要仔细检查移动设备是否支持苹果支付。 I found a library for stripe payment system @stripe/stripe-react-native and there are files that return method isApplePaySupported - true/false.我找到了一个条纹支付系统库@stripe/stripe-react-native ,并且有一些文件返回方法isApplePaySupported - true/false。

I need to use that method without installing that package and I have tried to extract the code which does that validation - I see that declaration of that method in that file node_modules@stripe\stripe-react-native\src\NativeStripeSdk.tsx but I cant find implementation.我需要在不安装 package 的情况下使用该方法,并且我试图提取执行该验证的代码 - 我在该文件node_modules@stripe\stripe-react-native\src\NativeStripeSdk.tsx中看到了该方法的声明,但我找不到实现。 I mean the code which I can run and get the same response with that isApplePaySupported method.我的意思是我可以使用isApplePaySupported方法运行并获得相同响应的代码。

I do not have big experience in structure of those react modules, but I check all files and can find the only declaration without implementation of that code.我对这些反应模块的结构没有丰富的经验,但是我检查了所有文件,并且可以找到唯一没有实现该代码的声明。 Can someone help me?有人能帮我吗?

To rewrite this function yourself, you'll have to write code that interfaces with native components, specifically PassKit.要自己重写此 function,您必须编写与本机组件(特别是 PassKit)接口的代码。

My recommendation would be to just install that ReactNative SDK from Stripe and use its functions as it does everything you need it to.我的建议是从 Stripe 安装 ReactNative SDK 并使用它的功能,因为它可以完成您需要的一切。 Especially if you're taking payments with Apple Pay, you need to run the payment through some payment provider, so if you're using Stripe then you need to use Stripe's SDK to actually accept a payment.特别是如果您使用 Apple Pay 付款,则需要通过某些支付提供商进行付款,因此如果您使用的是 Stripe,那么您需要使用 Stripe 的 SDK 来实际接受付款。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM