Flutter Pay插件集成Google Pay遇OR_BIBED_06错误求助
Flutter集成Google Pay(Stripe网关)出现OR_BIBED_06错误的解决方法
错误说明
遇到错误代码OR_BIBED_06,提示:
This merchant is having trouble accepting your payment right now. Try using a different payment method. [OR_BIBED_06]
该错误通常由测试环境配置不规范、参数格式错误或网关兼容性问题导致,以下是针对你代码的具体修复方案:
修复步骤
1. 测试环境使用Google Pay官方测试Merchant ID
在TEST环境下,不能使用正式的Google Merchant ID,必须使用官方指定的测试ID:"123456789012345678901"。你代码中${Config.googleMerchentIdentifier}如果是正式ID,会直接导致验证失败,替换为测试ID即可。
2. 更新Stripe API版本
你当前使用的Stripe版本2020-08-27过于陈旧,存在兼容性问题,建议更新到最新稳定版本(比如2024-06-20)。
3. 修正金额格式
Google Pay要求金额必须是带两位小数的字符串(比如"10.00"),而你代码中计算后直接转为整数字符串,会触发金额解析错误。需要将金额格式化为两位小数格式。
4. 简化支付参数(快速测试用)
如果仍有问题,可以暂时关闭账单地址必填项,减少验证环节,先确保支付流程能正常触发:
- 将
billingAddressRequired设为false - 移除
billingAddressParameters配置
修改后的完整代码示例
GooglePayButton( paymentConfiguration: pay.PaymentConfiguration.fromJsonString('''{ "provider": "google_pay", "data": { "environment": "TEST", "apiVersion": 2, "apiVersionMinor": 0, "allowedPaymentMethods": [{ "type": "CARD", "tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "stripe", "stripe:version": "2024-06-20", "stripe:publishableKey": "pk_test_51...." } }, "parameters": { "allowedCardNetworks": ["VISA", "MASTERCARD"], "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"], "billingAddressRequired": false } }], "merchantInfo": { "merchantId": "123456789012345678901", "merchantName": "E....." }, "transactionInfo": { "countryCode": "US", "currencyCode": "USD" } } }'''), paymentItems: [ pay.PaymentItem( amount: ((int.parse(controller.amount ?? '0') + (int.parse(controller.amount ?? '0') * (controller.paymentMethodModel?.eureecaFee ?? 0))) .floor() / 100) // 假设原金额为分单位,转换为元并保留两位小数 .toStringAsFixed(2), type: pay.PaymentItemType.total, label: 'Add money into Eureeca wallet' ) ], width: double.infinity, height: 48, type: pay.GooglePayButtonType.pay, cornerRadius: 4, margin: const EdgeInsets.only(top: 15.0), onPaymentResult: (paymentResult) async { // 处理支付结果逻辑 }, loadingIndicator: const Center( child: CircularProgressIndicator(), ), )
额外检查项
- 确认你的Stripe测试密钥
pk_test_51....有效,且关联账号已启用Google Pay支付方式 - 测试设备需添加Google Pay测试卡片(比如
4242 4242 4242 4242,有效期设为任意未来日期,CVV填任意3位数字)
内容的提问来源于stack exchange,提问作者Usama shahbaz
相关产品推荐
相关产品推荐

