Receipt_id 在 Paypal 响应中为 null,如何获取?

Receipt_id is null in Paypal response, How can I get it?

我已通过 activemerchant gem 将 Paypal 与我的 rails 应用程序集成,截至目前,我正在获取令牌和 payer_id,但我需要 receipt_id 这是响应为空。

我已按照 link 中给出的步骤进行操作。

Paypal 的回复如下

"timestamp"=>"2016-04-12T19:23:46Z", "ack"=>"Success", 
"correlation_id"=>"000a000f000r", "version"=>"124", "build"=>"000000", 
"token"=>"AB-000000000000000", "transaction_id"=>"kjKJKHkj09809FED2", 
"parent_transaction_id"=>NULL, "receipt_id"=>NULL, 
"transaction_type"=>"express-checkout", "payment_type"=>"instant", 
"payment_date"=>"2016-04-12T19:23:46Z", "gross_amount"=>"160.00", 
"gross_amount_currency_id"=>"USD", "fee_amount"=>"6.54", 
"fee_amount_currency_id"=>"USD", "tax_amount"=>"0.00", 
"tax_amount_currency_id"=>"USD", "exchange_rate"=>NULL, 
"payment_status"=>"Completed", "pending_reason"=>"none", 
"reason_code"=>"none", "protection_eligibility"=>"Eligible", 
"protection_eligibility_type"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible", 
"secure_merchant_account_id"=>"JHBJKJKJBKJBKJH",  
"success_page_redirect_requested"=>"false", 
"coupled_payment_info"=>NULL, "Token"=>"AB-000000000000000", 
"PaymentInfo"=>"{"TransactionID"=>"kjKJKHkj09809FED2", 
"ParentTransactionID"=>nil, "ReceiptID"=>nil, 
"TransactionType"=>"express-checkout", "PaymentType"=>"instant", 
"PaymentDate"=>"2016-04-12T19:23:46Z", "GrossAmount"=>"160.00", 
"FeeAmount"=>"6.54", "TaxAmount"=>"0.00", "ExchangeRate"=>nil, 
"PaymentStatus"=>"Completed", "PendingReason"=>"none", 
"ReasonCode"=>"none", "ProtectionEligibility"=>"Eligible", 
"ProtectionEligibilityType"=>"ItemNotReceivedEligible,UnauthorizedPaymentEligible", 
"SellerDetails"=>{"SecureMerchantAccountID"=>"JHBJKJKJBKJBKJH"}}", 
"SuccessPageRedirectRequested"=>"false", "CoupledPaymentInfo"=>NULL

Paypal 帐户中是否有任何配置来获取 receipt_id,或者我必须 add/change 的任何请求参数?

求推荐。

提前致谢。

我已经与 paypal 开发人员支持人员讨论过这个问题,交易销售 ID 似乎是要记录的适当 ID,return 对用户来说,它也是记录在 paypal 帐户中以获得信用的内容卡交易,因此如果用户有支持问题,这是提供给帐户以查找交易详细信息的最简单的号码。

我不是 100% 确定如何访问所谓的 receipt_id,但我认为它不会被填充到对支付端点的响应中。如果您要获得 receipt_id,它很可能来自到达终点 GET /v1/payments/sale/<Transaction-Id>

根据 api,receipt_id 定义为

Receipt id is 16 digit number payment identification number returned for guest users to identify the payment.

我认为 "guest users" 可能具有与任何交易无关的特定含义,但我对此并不乐观。

我建议使用这个 endpoint after you get the transaction ID from the payments 端点。位于 payment.transactions[0].related_resources[0].sale.id 支付端点的 json returned 中的 ID 似乎是合适的 ID记录一个简单的信用卡交易,我想 return 给客户一个参考号,并存储以供日后查找交易。

我还能够使用该 ID 查询上述销售端点以获取更多信息,但我从未能够 receipt_id 填充沙盒操作。

希望这有帮助,我发现 REST 缺少一些文档 api。

"transactions": [
    {
      "amount": {
        "total": "7.47",
        "currency": "USD",
        "details": {
          "tax": "0.03",
          "shipping": "0.03"
        }
      },
      "description": "This is the payment transaction description.",
      "related_resources": [
        {
          "sale": {
            "id": "4RR959492F879224U",
            "create_time": "2013-01-31T04:12:02Z",
            "update_time": "2013-01-31T04:12:04Z",