【问题标题】:Add Discount to Braintree Rails Transaction为 Braintree Rails 交易添加折扣
【发布时间】:2022-01-14 21:10:37
【问题描述】:

有没有办法给braintree交易添加折扣。我知道可以在订阅上这样做,但我想将它添加到非经常性计费交易中。这是我尝试过的,适用于Braintree::Subcription.create

result = gateway.transaction.sale(
      amount: amount,
      payment_method_token: token_generated,
      options: {
        submit_for_settlement: true
      },
      discounts: {
        add: [
            {
              inherited_from_id: "2rhw"
            }
          ]
        }
    )

这给了我折扣和添加的无效键错误。是否有解决方法或无法为单笔交易添加折扣。

【问题讨论】:

    标签: ruby-on-rails transactions braintree discount


    【解决方案1】:

    欢迎来到 Stack Overflow @Feroz Khan。

    你试过discount_amount吗?

    result = gateway.transaction.sale(
               amount: amount,
               payment_method_token: token_generated,
               options: {
                 submit_for_settlement: true
               },
               discount_amount: 50 # Amount you want to discount
             )
    

    Braintree Transaction Sale discount_amount

    【讨论】:

    • 是的,我有。 discount_amount 仅将该字段添加为交易记录的一部分,它实际上并未将折扣应用于交易
    猜你喜欢
    • 2014-03-04
    • 1970-01-01
    • 2020-04-04
    • 2012-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多