0
저장할 때 다음 방법을 실행하는 주문 컨트롤러가 있지만 운송 비용을 전달하는 데 문제가 있습니다.배송 비용을 레일로 페이팔에 추가하는 방법은 무엇입니까?
def paypal_url(return_url,cancel_url)
values = {
:business => '[email protected]',
:cmd => '_cart',
:upload => 1,
:return => return_url,
:invoice => @cart.id,
:cancel_return => cancel_url,
}
@cart.line_items.each_with_index do |item, index|
values.merge!({
"amount_#{index+1}" => item.total_price,
"item_name_#{index+1}" => item.product.title,
"item_id_#{index+1}" => item.id,
"quantity_#{index+1}" => item.quantity,
})
end
"https://www.sandbox.paypal.com/cgi-bin/webscr?" + values.to_query
end
본인은 "배송 및 취급 :"를 추가 할 지불 페이지에서,하지만 난 내 운송 비용 값입니다 페이팔을 말할 수있는 키를 찾을 수 없습니다.
나는 활성 상인을 시도했다, 그러나 그것은에 일을 더 복잡하다.