当前位置: 首页 > 知识库问答 >
问题:

使用存储的信用卡详细信息支付Paypal pro

傅星光
2023-03-14

是否可以使用此信用卡ID进行交易?有人帮忙吗?

共有1个答案

戚繁
2023-03-14

是的,你肯定可以使用上述收到的信用卡id使用存储卡付款。

我已经包含了您可以使用的卷曲请求:

请求

curl -v POST  "https://api.sandbox.paypal.com/v1/payments/payment" -H "Content-Type:application/json" -H "Authorization: Bearer A0430YIJHh.TrJ7DuXoVVSzzRD9BiNhc7.JUdtWFV9bm6PM" -d "{\"intent\":\"sale\",\"payer\":{\"payment_method\":\"credit_card\",\"funding_instruments\":[{\"credit_card_token\":{\"credit_card_id\":\"CARD-7F19874*H7676925VKQ55ALQ\"}}]},\"transactions\":[{\"amount\":{\"total\":\"7.47\",\"currency\":\"USD\"},\"description\":\"This is the payment transaction description.\"}]}"
{"id":"PAY-17C52753U3213490GKQ56FJQ","create_time":"2014-10-13T14:33:10Z","updat
e_time":"2014-10-13T14:33:28Z","state":"approved","intent":"sale","payer":{"paym
ent_method":"credit_card","funding_instruments":[{"credit_card_token":{"credit_c
ard_id":"CARD-7F116246H7676925VKQ55ALQ","last4":"0331","type":"visa","expire_mon
th":"11","expire_year":"2018"}}]},"transactions":[{"amount":{"total":"7.47","cur
rency":"USD","details":{"subtotal":"7.47"}},"description":"This is the payment t
ransaction description.","related_resources":[{"sale":{"id":"0TD97130MF446714A",
"create_time":"2014-10-13T14:33:10Z","update_time":"2014-10-13T14:33:28Z","amoun
t":{"total":"7.47","currency":"USD"},"state":"completed","parent_payment":"PAY-1
7C52753U3213490GKQ56FJQ","links":[{"href":"https://api.sandbox.paypal.com/v1/pay
ments/sale/0TD97130MF446714A","rel":"self","method":"GET"},{"href":"https://api.
sandbox.paypal.com/v1/payments/sale/0TD97130MF446714A/refund","rel":"refund","me
thod":"POST"},{"href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-17
C52753U3213490GKQ56FJQ","rel":"parent_payment","method":"GET"}]}}]}],"links":[{"
href":"https://api.sandbox.paypal.com/v1/payments/payment/PAY-17C52753U3213490GK
Q56FJQ","rel":"self","method":"GET"}]}
{
  "intent": "sale",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card_token": {
          "credit_card_id": "CARD-7F19874*H7676925VKQ55ALQ"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD"
      },
      "description": "This is the payment transaction description."
    }
  ]
}
{
  "id": "PAY-8U155502YW812893MKQ55D7Q",
  "create_time": "2014-10-13T13:22:06Z",
  "update_time": "2014-10-13T13:22:27Z",
  "state": "approved",
  "intent": "sale",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card_token": {
          "credit_card_id": "CARD-7F19874*H7676925VKQ55ALQ",
          "last4": "0331",
          "type": "visa",
          "expire_month": "11",
          "expire_year": "2018"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD",
        "details": {
          "subtotal": "7.47"
        }
      },
      "description": "This is the payment transaction description.",
      "related_resources": [
        {
          "sale": {
            "id": "5U920323FW4849716",
            "create_time": "2014-10-13T13:22:06Z",
            "update_time": "2014-10-13T13:22:27Z",
            "amount": {
              "total": "7.47",
              "currency": "USD"
            },
            "state": "completed",
            "parent_payment": "PAY-8U155502YW812893MKQ55D7Q",
            "links": [
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/5U920323FW4849716",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/sale/5U920323FW4849716/refund",
                "rel": "refund",
                "method": "POST"
              },
              {
                "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8U155502YW812893MKQ55D7Q",
                "rel": "parent_payment",
                "method": "GET"
              }
            ]
          }
        }
      ]
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-8U155502YW812893MKQ55D7Q",
      "rel": "self",
      "method": "GET"
    }
  ]
}
<?php

//open connection
$ch = curl_init();

$client="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$secret="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/oauth2/token");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_USERPWD, $client.":".$secret);
curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=client_credentials");

$result = curl_exec($ch);

if(empty($result))die("Error: No response.");
else
{
    $json = json_decode($result);
    print_r($json->access_token);
}

// Now doing txn after getting the token 

$ch = curl_init();

$data = '{
  "intent": "sale",
  "payer": {
    "payment_method": "credit_card",
    "funding_instruments": [
      {
        "credit_card_token": {
          "credit_card_id": "CARD-76K83451273207050KQ6MXDQ"
        }
      }
    ]
  },
  "transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD"
      },
      "description": "This is the payment transaction description."
    }
  ]
}';

curl_setopt($ch, CURLOPT_URL, "https://api.sandbox.paypal.com/v1/payments/payment");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Authorization: Bearer ".$json->access_token));

$result = curl_exec($ch);


if(empty($result))die("Error: No response.");
else
{
    $json = json_decode($result);
    print_r($json);
}

?>
 类似资料:
  • 问题内容: 我如何验证信用卡。我需要做检查。黑莓中有API可以做到吗? 问题答案: 您可以使用以下方法来验证信用卡号

  • 嗨,我一直在我的项目中第一次使用条纹,我要求用户提供他们的信用卡支付细节 我尝试将name属性添加到stripe生成令牌所需的字段中,但是在表单POST中它是空的。

  • count Number size Number liveSize Number

  • 我可以使用razorpay API获取付款ID。。。但现在我想获取其他付款详细信息,而不是付款ID。。。我怎样才能从Razorpay拿到数据

  • 我想给我的客户这个选择付款方式: 贝宝 信用卡 Paypal工作正常(我用的是PHP REST Api): 但是对于信用卡支付,我找不到任何接口?API示例已经需要信用卡信息,但我希望PayPal这样做?搜索时,我只找到NVP Express API,但此API已经弃用。

  • 本文向大家介绍PayPal使用信用卡(节点)进行支付,包括了PayPal使用信用卡(节点)进行支付的使用技巧和注意事项,需要的朋友参考一下 示例 在此示例中,我们将研究如何使用PayPal保管库存储信用卡,然后参考存储的信用卡来为用户处理信用卡交易。 我们之所以要使用保管库,是因为我们不必在自己的服务器上存储敏感的信用卡信息。我们仅通过提供的保管库ID引用付款方式,这意味着我们不必自己存储信用卡就