petsHero-AI/docs/googlepay.md
2026-03-12 14:30:19 +08:00

1.5 KiB

支付界面

recharge_screen.dart

        "extrapolate": "",    // note (string) 备注
        "helm": "",    // code (string) 产品代码
        "forge": 0,    // bonus (int) 赠送积分
        "guardian": "",    // actualAmount (string) 实际金额
        "lead": "",    // discountOff (string) 折扣
        "glossary": "",    // title (string) 标题
        "curriculum": "",    // originAmount (string) 原价
        "warrior": "",    // activityId (string) 活动ID
        "distribute": "",    // subscriptionPeriod (string) 订阅周期
        "greaves": 0,    // credits (int) 积分数
        "shield": "",    // client (string) 客户端
        "species": 0,    // days (int) 天数
        "familiar": "",    // currency (string) 货币
        "subtract": 0    // productType (int) 产品类型

其中helm 为google pay的商品ID

界面要展示

1.价格需显示$符号 字段guardian 2.原价需显示中划线 字段curriculum 3.赠送积分 字段forge

购买

从/v1/user/common_info接口里面取到 enable_third_party_payment字段如果这个字段为true则调用第三方支付

三方支付流程

获取商品列表/v1/payment/getGooglePayActivities -> 传activityId获取支付列表/v1/payment/get-payment-methods -> 创建订单的时候把选择的支付方式的字段填充,创建订单/v1/payment/createPayment 创建订单传app、userId、activityId、paymentMethod、subPaymentMethod(有的话),其他那些先不管

谷歌支付回调接口

/v1/payment/googlepay