Ruby on rails 4 Paypal响应中收据id为空,如何获取?
我已经通过activemerchant gem将Paypal与我的rails应用程序集成在一起,目前我正在获取令牌和付款人id,但我需要收据id,该id为空作为响应 我遵循了本文中给出的步骤 贝宝的回应如下Ruby on rails 4 Paypal响应中收据id为空,如何获取?,ruby-on-rails-4,paypal-sandbox,activemerchant,Ruby On Rails 4,Paypal Sandbox,Activemerchant,我已经通过activemerchant gem将Paypal与我的rails应用程序集成在一起,目前我正在获取令牌和付款人id,但我需要收据id,该id为空作为响应 我遵循了本文中给出的步骤 贝宝的回应如下 "timestamp"=>"2016-04-12T19:23:46Z", "ack"=>"Success", "correlation_id"=>"000a000f000r", "version"=>"124", "build"=>"000000", "to
"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帐户中是否有任何配置以获取收据id,或者我必须添加/更改的任何请求参数
请建议
提前感谢。我已经与paypal开发者支持部门讨论过这一点,似乎交易销售ID是记录并返回给用户的合适ID,也是信用卡交易的paypal帐户中记录的ID,因此如果用户有支持问题,这是最简单的数字给帐户查询交易详情 我不能100%确定如何访问所谓的收据id,但我不认为应该在对支付端点的响应中填充收据id。如果您想要获得收据id,那么它很可能来自于点击端点
get/v1/payments/sale/
根据api,收据id定义为
收据id是返回给来宾用户的16位数字付款识别号,用于识别付款
我认为“客户用户”可能有一个特定的含义,它与任何交易都不相关,但我对此并不乐观
我建议您在从端点获得事务ID后再使用它。位于从payment.transactions[0]处的payments端点返回的json中的id。相关的_资源[0]。sale.id似乎是为简单的信用卡交易记录的合适id,我希望在该交易中向客户端返回一个参考号,并存储以备日后查询该交易
我还可以使用该ID查询上面提到的销售端点以获取更多信息,但我从未能够获得收据ID来填充沙箱操作
希望这能有所帮助,我发现RESTAPI缺少一些文档
"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",
您是在使用沙箱还是在实际事务中使用沙箱?我有一个类似的问题(实际上是在.NET中),但使用沙盒时,我也有一个空的收据id,我想这可能是因为它不是一个完整的交易,一个真实的交易可能有收据id。是的,我使用的是沙盒帐户。