0

使用 PAYPAL REST API,我能够成功 (1) 保管信用卡和 (2) 查找保管的信用卡信息。

在您查找 Vaulted Credit Card 并收到 Paypal 的回复后;但是,您是否会在将来重新使用该响应数据来创建交易?

#How to Look up the Vaulted Credit Card
curl -v [link removed]/CARD-8TT93830P06829326KIOO3XI -H "Content-Type:application/json" -H "Authorization:Bearer O912TKmsB8WRsgdNrNrJAmlCqF5kLdEl.re3z4Kmp8M"

#Paypal's Response to the Lookup Request
{"id":"CARD-8TT93830P06829326KIOO3XI","valid_until":"2016-08-26T00:00:00Z","state":"ok","payer_id":"user12345","type":"visa","number":"xxxxxxxxxxxx0331","expire_month":"11","expire_year":"2018","first_name":"Joe","last_name":"Shopper","links":[{"href":"[link removed]/CARD-8TT93830P06829326KIOO3XI","rel":"self","method":"GET"},{"href":"[link removed]/CARD-8TT93830P06829326KIOO3XI","rel":"delete","method":"DELETE"}]}

我正在寻找一个 curl 命令,它允许我使用 Vaulted Credit Card 按月计费。

4

1 回答 1

0

您将使用相同的/payment调用,但将卡数据切换为credit_card_id.

例如;

{
  "intent": "sale",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card_token": {
          "credit_card_id": "CARD-XXXXXXXXXXXXXX"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD"
      },
      "description": "This is the payment transaction description."
    }
  ]
}

或在 cURL 中:

curl -v https://api.sandbox.paypal.com/v1/payments/payment -X POST -H "Content-Type:application/json" -H "Authorization:Bearer xxxxxxxxx" -d '{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card_token":{"credit_card_id":"CARD-9ND477057R590115SKIOT7OY"}}]},"transactions":[{"amount":{"total":"7.47","currency":"USD"},"description":"This is the payment transaction description."}]}'

文档中也有更多关于此的信息。

于 2013-08-28T00:16:40.190 回答