簡體   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