我正在使用http://jsfiddle.net/tintucraju/fm0sL4s9/我正在尝试使用快速结账和自适应付款来整合PayPal。在自适应付款中,我能够查看购物车内容,如下所示ActiveMerchant。我的代码就像这样按预期工作。
express_checkout
但是使用def express_checkout
listing = Listing.find(session[:listing_id].to_f)
response = EXPRESS_GATEWAY.setup_purchase(session[:amount].to_f,
ip: request.remote_ip,
return_url: "http://esignature.lvh.me:3000/en/transactions/status",
cancel_return_url: "http://esignature.lvh.me:3000/",
currency: "USD",
allow_guest_checkout: true,
items: [{name: listing.title, description: listing.description, quantity: session[:number_of_days], amount: listing.price_cents},
{name: "Service Charge", amount: session[:service_charge]}
]
)
redirect_to EXPRESS_GATEWAY.redirect_url_for(response.token)
end
def status
if (params[:token].present? && params[:PayerID].present?)
token = params[:token]
@response = EXPRESS_GATEWAY.details_for(token).params
express_purchase_options = {
:ip => request.remote_ip,
:token => params[:token],
:payer_id => params[:PayerID]
}
response = EXPRESS_GATEWAY.purchase(session[:amount].to_f, express_purchase_options)
if response.message == "Success"
listing = Listing.find(session[:listing_id].to_f)
BookingInfo.create!(listing_id: listing.id, start_on: session[:start_date].to_date, end_on: session[:end_date].to_date)
render 'status'
else
render 'status_error'
end
reset_session_params
else
reset_session_params
redirect_to homepage_without_locale_path
end
end
,我无法在交易明细中看到我的购物车内容
但是在交易期间,会显示项目详细信息, 对于快速结账,我的代码就像这样
set_payment_options
我尝试使用structure(list(code = structure(c(25L, 37L, 13L,
29L, 17L, 10L, 24L, 20L, 38L, 35L, 32L, 28L, 26L, 39L, 21L, 15L,
31L, 9L, 16L, 23L, 7L, 18L, 42L, 34L, 4L, 33L, 19L, 22L, 27L), .Label = c("LP6005500-DNA_D01",
"LP6005334-DNA_E02", "LP6005334-DNA_G03", "LP6007427-DNA_A01",
"LP6005935-DNA_C03", "LP2000104-DNA_A01", "LP6005690-DNA_D01",
"LP6005409-DNA_C02", "LP6005500-DNA_D03", "LP6005334-DNA_D03",
"LP6005334-DNA_D01", "LP6007514-DNA_A01", "LP6005334-DNA_B02",
"LP6005334-DNA_F03", "LP6005500-DNA_B01", "LP6005500-DNA_E01",
"LP6005334-DNA_C03", "LP6005690-DNA_H01", "LP6007538-DNA_A01",
"LP6005334-DNA_E03", "LP6005500-DNA_A01", "LP6007540-DNA_A01",
"LP6005500-DNA_F01", "LP6005334-DNA_E01", "LP6005334-DNA_A02",
"LP6005409-DNA_A03", "LP6007542-DNA_A01", "LP6005334-DNA_H03",
"LP6005334-DNA_C02", "LP6007409-DNA_A01", "LP6005500-DNA_C01",
"LP6005334-DNA_H01", "LP6007512-DNA_A01", "LP6007424-DNA_A01",
"LP6005334-DNA_G02", "LP6005334-DNA_C01", "LP6005334-DNA_A03",
"LP6005334-DNA_F01", "LP6005409-DNA_C04", "LP6005334-DNA_D02",
"LP6007418-DNA_A02", "LP6007396-DNA_A01", "LP6005334-DNA_F02"
), class = "factor"), freq = c(503, 597, 354, 522, 399, 338,
498, 430, 606, 590, 561, 518, 508, 618, 436, 373, 559, 328, 382,
491, 313, 408, 683, 585, 261, 570, 423, 477, 515), CNI = c(21L,
54L, 25L, 32L, 19L, 23L, 21L, 18L, 25L, 29L, 32L, 27L, 37L, 49L,
26L, 11L, 11L, 24L, 13L, 31L, 19L, 21L, 28L, 32L, 17L, 44L, 22L,
20L, 15L)), .Names = c("code", "freq", "CNI"), row.names = c(1L,
2L, 3L, 5L, 6L, 9L, 10L, 12L, 13L, 16L, 18L, 19L, 20L, 22L, 23L,
24L, 25L, 27L, 28L, 29L, 30L, 31L, 33L, 35L, 36L, 37L, 39L, 40L,
41L), class = "data.frame")
方法,但提出了方法缺失错误。有没有其他方法可以在快速结账时附上商品详情。
答案 0 :(得分:1)
您是否也在DoExpressCheckout调用中包含订单项详情?如果您只是在SetExpressCheckout呼叫中发送它们,它们将显示在上面列出的结账屏幕中,但如果未包含在DoExpressCheckout呼叫中,它们将不会显示在交易详细信息中。
https://github.com/activemerchant/active_merchant/issues/1912