如何使用Stripe API处理Google支付数据以进行付款

时间:2019-06-12 19:30:37

标签: javascript stripe-payments google-pay

我在自己的网站上集成了google pay,到目前为止,它一直在工作。单击Google Pay按钮等后,我从JSON中的Google Pay接收到用户的信用卡数据。我的问题是如何在我的条纹付款处理中实现此json。

我从Google收到了该PaymentToken

  "id": "tok_1Ekc1IAI1F3KLXRkt0mbQqs4",
  "object": "token",
  "card": {
    "id": "card_1Ekc1HAI1F3KLXRk7MGLIfhr",
    "object": "card",
    "address_city": null,
    "address_country": null,
    "address_line1": null,
    "address_line1_check": null,
    "address_line2": null,
    "address_state": null,
    "address_zip": null,
    "address_zip_check": null,
    "brand": "Visa",
    "country": "US",
    "cvc_check": null,
    "dynamic_last4": "xxxx",
    "exp_month": x,
    "exp_year": xxxx,
    "funding": "credit",
    "last4": "9998",
    "metadata": {
    },
    "name": "Jon Doe",
    "tokenization_method": "android_pay"
  },
  "client_ip": "11.111.111.11",
  "created": 1560367324,
  "livemode": false,
  "type": "card",
  "used": false
}

Google已经使用条纹网关生成令牌tok_1Ekc1IAI1F3KLXRkt0mbQqs4,但我不知道现在该怎么办。

我以为我可以使用https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment中的stripe.handleCardPayment函数,但我也无法解决。

0 个答案:

没有答案