簡體   English   中英

如何在Rails中增加Paypal的運費?

[英]How to add shipping cost to Paypal in rails?

我有一個訂單控制器,當保存時將觸發以下方法,但是我在傳遞運費時遇到問題。

 def paypal_url(return_url,cancel_url)
    values = {
      :business => 'seller@mail.com',
      :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

我想在付款頁面中添加“運輸和處理:”,但是我找不到告訴貝寶的鑰匙,這是我的運輸成本值。

預覽圖片

我已經嘗試過活躍的商人,但這工作起來更加復雜。

運輸和處理成本在Paypal帳戶中的郵費計算/運輸計算中設置

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM