繁体   English   中英

PayPal Rest API-实时付款失败,沙盒正常工作

[英]PayPal Rest API - Live payments fail, sandbox works

我建立了一个工作清单网站,您可以在该网站上付费发布自己的工作清单。 一切都按预期工作,甚至包括工作搜索功能和用户注册/资料系统。 全部直播,看起来很棒!

但是,既然我们已将PayPal切换到实时凭证,则付款无法正常进行。 它正在与Sandbox一起使用...我尽可能地遵循Rest API,允许使用可选字段并要求使用必填字段,并按照API文档中的定义发送正确的类型格式(整数,字符串和对象)...

尽管如此,尝试付款的每个人都会收到“信用卡被拒绝”的通知。 我已经联系了贝宝,并且经过反复的尝试来解决问题,但是他们坚持认为问题还没有结束。

我还将在电子邮件中包含以下调试信息,以支付给Paypal,但是也许有人在此问题上有更多经验,可以为我提供帮助。

这是使用我自己的个人信用卡提交的JSON代码(当然,敏感信息已删除):

{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**hidden**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**hidden**","first_name":"Radley","last_name":"Sustaire","billing_address":{"line1":"**removed**","city":"Veneta","postal_code":"97487","country_code":"US","state":"OR"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"USD"},"description":"Purchased product: 30-Day Free Job Listing"}]}

以下是从cURL(在对象布局中)从PayPal收到的结果:

Submitted information (CC Details masked):
array(3) {
  ["intent"]=>
  string(4) "sale"
  ["payer"]=>
  array(2) {
    ["payment_method"]=>
    string(11) "credit_card"
    ["funding_instruments"]=>
    array(1) {
      [0]=>
      array(1) {
        ["credit_card"]=>
        array(8) {
          ["number"]=>
          string(10) "**removed**"
          ["type"]=>
          string(10) "mastercard"
          ["expire_month"]=>
          int(10)
          ["expire_year"]=>
          int(2016)
          ["cvv2"]=>
          string(10) "**removed**"
          ["first_name"]=>
          string(6) "Radley"
          ["last_name"]=>
          string(8) "Sustaire"
          ["billing_address"]=>
          array(5) {
            ["line1"]=>
            string(15) "**removed**"
            ["city"]=>
            string(6) "Veneta"
            ["postal_code"]=>
            string(5) "97487"
            ["country_code"]=>
            string(2) "US"
            ["state"]=>
            string(2) "OR"
          }
        }
      }
    }
  }
  ["transactions"]=>
  array(1) {
    [0]=>
    array(2) {
      ["amount"]=>
      array(2) {
        ["total"]=>
        string(4) "1.00"
        ["currency"]=>
        string(3) "USD"
      }
      ["description"]=>
      string(42) "Purchased product: 30-Day Free Job Listing"
    }
  }
}

---
Submitted information (JSON):
string(482) "{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**removed**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**removed**","first_name":"Radley","last_name":"Sustaire","billing_address":{"line1":"**removed**","city":"Veneta","postal_code":"97487","country_code":"US","state":"OR"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"USD"},"description":"Purchased product: 30-Day Free Job Listing"}]}"
---
cURL Headers:
array(6) {
  ["CURLOPT_POST"]=>
  bool(true)
  ["CURLOPT_SSL_VERIFYPEER"]=>
  bool(false)
  ["CURLOPT_HEADER"]=>
  bool(false)
  ["CURLOPT_RETURNTRANSFER"]=>
  bool(true)
  ["CURLOPT_HTTPHEADER"]=>
  array(3) {
    [0]=>
    string(65) "Authorization: Bearer **removed**"
    [1]=>
    string(24) "Accept: application/json"
    [2]=>
    string(30) "Content-Type: application/json"
  }
  ["CURLOPT_POSTFIELDS"]=>
  array(1) {
    [0]=>
    string(484) "{"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"**removed**","type":"mastercard","expire_month":10,"expire_year":2016,"cvv2":"**removed**","first_name":"Radley","last_name":"Sustaire","billing_address":{"line1":"**removed**","city":"Veneta","postal_code":"97487","country_code":"US","state":"OR"}}}]},"transactions":[{"amount":{"total":"1.00","currency":"USD"},"description":"Purchased product: 30-Day Free Job Listing"}]}"
  }
}

---
Paypal Response (raw):
string(191) "{"name":"CREDIT_CARD_REFUSED","message":"Credit card was refused","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#CREDIT_CARD_REFUSED","debug_id":"ab5d7c220fd22"}"

---
Paypal Response (Object):
object(stdClass)#385 (4) {
  ["name"]=>
  string(19) "CREDIT_CARD_REFUSED"
  ["message"]=>
  string(23) "Credit card was refused"
  ["information_link"]=>
  string(76) "https://developer.paypal.com/webapps/developer/docs/api/#CREDIT_CARD_REFUSED"
  ["debug_id"]=>
  string(13) "ab5d7c220fd22"
}

---
HTTP Info:
array(23) {
  ["url"]=>
  string(42) "https://api.paypal.com/v1/payments/payment"
  ["content_type"]=>
  string(16) "application/json"
  ["http_code"]=>
  int(400)
  ["header_size"]=>
  int(495)
  ["request_size"]=>
  int(687)
  ["filetime"]=>
  int(-1)
  ["ssl_verify_result"]=>
  int(0)
  ["redirect_count"]=>
  int(0)
  ["total_time"]=>
  float(5.217304)
  ["namelookup_time"]=>
  float(2.1E-5)
  ["connect_time"]=>
  float(0.088343)
  ["pretransfer_time"]=>
  float(0.367546)
  ["size_upload"]=>
  float(481)
  ["size_download"]=>
  float(191)
  ["speed_download"]=>
  float(36)
  ["speed_upload"]=>
  float(92)
  ["download_content_length"]=>
  float(-1)
  ["upload_content_length"]=>
  float(0)
  ["starttransfer_time"]=>
  float(5.216257)
  ["redirect_time"]=>
  float(0)
  ["certinfo"]=>
  array(0) {
  }
  ["primary_ip"]=>
  string(11) "**removed*"
  ["redirect_url"]=>
  string(0) ""
}

---
cURL Error #: int(0)

在查看了该特定debug_id的日志后,这显示为标准付款下降。 这不是一个集成问题。 如果您需要更多具体信息,则需要与客户支持联系,并让他们查询您所使用卡的付款尝试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM