调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
财务自动化
平台和交易市场
资金管理
开发人员工具
开始
付款
财务自动化
开始
付款
财务自动化
平台和交易市场
资金管理
概览
关于 Stripe 支付
升级您的集成
支付分析
线上付款
概览查找您的用例Managed Payments
使用 Payment Link
构建结账页面
构建高级集成
构建应用内集成
支付方式
添加支付方式
    概览
    支付方式集成选项
    在管理平台中管理默认支付方式
    支付方式类型
    银行卡
    银行借记
    银行重定向
    银行转账
    贷记转账(来源)
    先买后付
    实时付款
    付款凭单
    钱包
      支付宝
      Amazon Pay
      Apple Pay
      Cash App Pay
      Google Pay
      GrabPay
      Link
      MB WAY
      MobilePay
      PayPal
      PayPay
      Revolut Pay
      Satispay
      Secure Remote Commerce
      Vipps
      微信支付
    按国家启用本地支付方式
    自定义支付方式
管理支付方式
用 Link 更快结账
支付接口
Payment Links
结账
Web Elements
应用内 Element
支付场景
自定义支付流程
灵活收单
编排
线下支付
Terminal
其他 Stripe 产品
Financial Connections
加密货币
Climate
首页付款Add payment methodsWallets

Google Pay

了解如何用 Google Pay 收款。

复制页面

Pricing and fees

For information on payment method transaction fees, refer to pricing details.

借助 Google Pay,客户可以用他们在 Google 账户中存储的信用卡或借记卡在您的应用或网站上进行支付,包括 Google Play、YouTube、Chrome 或 Andriod 设备中绑定的银行卡。用 Google Pay API 请求您的客户在 Google 账户中存储的任何信用卡或借记卡。

Google Pay 与 Stripe 的产品和功能(例如,经常性付款)完全兼容,您可以随时在需要时用它替换传统的支付表单。用它来接收实物商品、捐赠、订阅等的付款。

Google Pay 条款

集成 Google Pay,表示您同意 Google 的服务条款。

  • 客户所在地

    印度以外的全球

  • 出示货币

    参见受支持的出示货币

  • 支付确认

    客户发起

  • 支付方式类型

    钱包

  • 经常性付款

    是

  • 提现时间

    适用标准提现时间

  • Connect 支持

    是

  • 争议支持

    是

  • 手动捕获支持

    是

  • 退款/部分退款

    是 / 是

使用 Stripe 和 Google Pay 与 Google Play 计费系统

对于实物商品和服务的销售,您的应用程序可以接受 Google Pay 或任何其他 Stripe 支持的支付方式。这些付款是通过 Stripe 处理的,只需支付 Stripe 的手续费。但是,应用内购买数字产品和内容必须使用 Google Play 计费系统。这些付款由 Google 处理,会收取交易费。

有关哪些购买必须使用 Google Play 计费系统的更多信息,请参见 Google Play 的开发人员条款。

Stripe 的 React Native SDK 是在您的 React Native 应用中开始接受 Google Pay 的最快最便捷的方式。PlatformPayButton 组件包着 Google 要求的 UI,您可以通过最少的设置,用 confirmPlatformPayPayment 和 createPlatformPayPaymentMethod 方式在您的应用中无缝收取或创建付款。

设置 Stripe
服务器端
客户端

服务器端

该集成要求您的服务器上的端点与 Stripe API 通讯。请用我们的官方库从您的服务器访问 Stripe API:

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

客户端

React Native SDK 是开源的,有完整的文档。在内部,它利用的是原生 iOS 和 Android SDK。要安装 Stripe 的 React Native SDK,在您的项目目录中运行以下某个指令(取决于您使用的软件包管理器)。

Command Line
yarn add @stripe/stripe-react-native

然后,安装一些其他必要的依赖项:

  • 对于 iOS,前往 ios 目录并运行 pod install,确保您也安装了所需的本地依赖项。
  • 对于 Android,无需安装其他依赖项。

Stripe 初始化

To initialize Stripe in your React Native app, either wrap your payment screen with the StripeProvider component, or use the initStripe initialization method. Only the API publishable key in publishableKey is required. The following example shows how to initialize Stripe using the StripeProvider component.

import { StripeProvider } from '@stripe/stripe-react-native'; function App() { const [publishableKey, setPublishableKey] = useState(''); const fetchPublishableKey = async () => { const key = await fetchKey(); // fetch key from your server here setPublishableKey(key); }; useEffect(() => { fetchPublishableKey(); }, []); return ( <StripeProvider publishableKey={publishableKey} merchantIdentifier="merchant.identifier" // required for Apple Pay urlScheme="your-url-scheme" // required for 3D Secure and bank redirects > // Your app code here </StripeProvider> ); }

注意

Use your API test keys while you test and develop, and your live mode keys when you publish your app.

启用 Google Pay

要使用 Google Pay,先将以下内容添加到您的 AndroidManifest.xml 的 <application>标签,来启用 Google Pay API:

AndroidManifest.xml
<application> ... <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /> </application>

更多详情,请参见 Google Pay 针对 Android 设备编写的设置 Google Pay API 指南。

创建 PaymentIntent
服务器端

首先,在您的服务器上创建一个 PaymentIntent,并指定要收取的金额和币种。如果您已经有使用 Payment Intents API 的集成,则为您的 PaymentIntent 向 支付方式类型列表中添加 card(在未提供支付方式的情况下,这也是默认支付方式)。

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "payment_method_types[]"=card \ -d amount=1099 \ -d currency=usd

PaymentIntent 包含一个客户端私钥。您可以在您的 React Native 应用中用客户端私钥安全地完成付款流程,而非传回整个 PaymentIntent 对象。在您的应用中,从您的服务器请求 PaymentIntent 并保存它的客户端私钥。

初始化 Google Pay
客户端

首先,通过调用 isPlatformPaySupported 查看设备是否支持 Google Pay。

import { usePlatformPay } from '@stripe/stripe-react-native'; function PaymentScreen() { const { isPlatformPaySupported } = usePlatformPay(); React.useEffect(() => { (async function () { if (!(await isPlatformPaySupported({ googlePay: {testEnv: true} }))) { Alert.alert('Google Pay is not supported.'); return; } })(); }, []); ... return ( <View > ... </View> ); }

展示 Google Pay 表单
客户端

开通 Google Pay 并且您的应用程序获得了 PaymentIntent 或 SetupIntent 客户端私钥后,调用 confirmPlatformPayPayment。确认 SetupIntent 时,改为使用 confirmPlatformPaySetupIntent。

import {PlatformPayButton, usePlatformPay} from '@stripe/stripe-react-native'; function PaymentScreen() { const { isPlatformPaySupported, confirmPlatformPayPayment, } = usePlatformPay(); React.useEffect(() => { ... // see above }, []); const fetchPaymentIntentClientSecret = async () => { // Fetch payment intent created on the server, see above const response = await fetch(`${API_URL}/create-payment-intent`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ currency: 'usd', }), }); const { clientSecret } = await response.json(); return clientSecret; }; const pay = async () => { const clientSecret = await fetchPaymentIntentClientSecret(); const { error } = await confirmPlatformPayPayment( clientSecret, { googlePay: { testEnv: true, merchantName: 'My merchant name', merchantCountryCode: 'US', currencyCode: 'USD', billingAddressConfig: { format: PlatformPay.BillingAddressFormat.Full, isPhoneNumberRequired: true, isRequired: true, }, }, } ); if (error) { Alert.alert(error.code, error.message); // Update UI to prompt user to retry payment (and possibly another payment method) return; } Alert.alert('Success', 'The payment was confirmed successfully.'); }; return ( <View > <PlatformPayButton type={PlatformPay.ButtonType.Pay} onPress={pay} style={{ width: '100%', height: 50, }} /> </View> ); }

可选创建 PaymentMethod
客户端

推出 Google Pay

按照 Google 的说明,请求访问您的应用程序的生产环境。收到提示时,选择集成类型 Gateway,并提供您的应用的截图供审核。

您的应用程序得到批准后,用 testEnv: false 在生产模式下测试您的集成,然后从一个签署的已发布版本启动 Google Pay。请记得使用您的真实模式下的 API 密钥。您可以用包含 capture_method = manual 的 PaymentIntent 来在不捕获付款的情况下处理交易。

争议

用户必须验证用他们的 Google Pay 账户进行的付款,以降低发生欺诈或付款无法识别的风险。但是,用户仍然可以在完成付款后对交易提出争议。您可以直接提交证据,对争议提出质疑。争议流程与银行卡付款相同。了解如何管理争议。

Google Pay 收款的责任转移

Google Pay 支持全球范围内的责任转移。使用 Stripe 托管产品和 Stripe.js 的用户可自动启用。对于 Stripe 托管产品之外的 Visa 交易,必须在 Google Pay 和 Wallet Console 中启用责任转移。为此,请导航到您的 Google Pay & Wallet Console,选择左侧导航栏中的_Google Pay API_,然后为责任转移保护启用 Fraud Liability Protection for Visa Device Tokens。

Google Pay 交易可在三种场景中使用:

  1. 如果用户用其移动设备向 Google Pay 应用添加银行卡,则该卡会作为一个设备主账号 (DPAN) 进行保存,并且默认支持责任转移。
  2. 如果用户向 Chrome 或 Google 的一个属性(例如,YouTube 或 Play)添加银行卡,那么该银行卡会作为充值主账号 (FPAN) 进行保存。当您使用 3DS 验证时,我们全球支持所有主要卡组织的责任转移,包括 Visa。您可以自定义 Stripe Radar 规则来请求激活 3DS 验证。
  3. 如果用户在用 Google Pay 支付的电商网站或应用中选择 Google Pay 作为支付方式,则这些卡将以电商令牌的形式保存,在文件中表示这些卡。目前电商令牌不支持责任转移和 3DS 验证。

对于 Sigma 用户,charges 表包含一个指示 Google Pay 交易类型的 card_token_type 字段。FPAN 交易将 card_token_type 设置为 fpan。DPAN 和电商令牌交易将 card_token_type 设置为 dpan_or_ecommerce_token。

退款

您可以部分或全额退还任何成功的 Google Pay 付款。退款流程与银行卡付款相同。有关发起或管理退款的说明,请参阅退款和取消付款。

测试 Google Pay

您不能将 Stripe 的测试卡信息保存到 Google Pay 钱包。而是,在您使用测试 API 密钥时 Stripe 会识别出,并返回一个成功的测试卡令牌供您使用。这样您即可用真实卡进行测试付款,不会被扣款。

此页面的内容有帮助吗?
是否
需要帮助?联系支持。
加入我们的早期使用计划。
查看我们的更改日志。
有问题?联系销售。
LLM? Read llms.txt.
Powered by Markdoc