【问题标题】:How do I save a name with my customer payment profile via ActiveMerchant::AuthorizeNetCimGateway?如何通过 ActiveMerchant::AuthorizeNetCimGateway 在我的客户付款资料中保存名称?
【发布时间】:2021-07-04 19:13:31
【问题描述】:

Authorize.net 上的 UI 显然有一个名称和地址信息的位置,我可以手动添加/编辑。

但我不知道如何在卡片中添加姓名信息

根据:

但是Active Merchant source file似乎只使用了卡号、有效期和卡号,而且卡上的姓名信息也没有发送到Authorize.net。

有人知道怎么做吗?

【问题讨论】:

    标签: ruby authorize.net activemerchant


    【解决方案1】:

    好的,为后代解决这个问题,使用bill_to

        def create_payment_profile
          response = GatewayService.gateway.create_customer_payment_profile(
            customer_profile_id: owner.gateway_profile,
            payment_profile: {
              bill_to: bill_to,
              payment: {
                credit_card: credit_card
              }
            }
          )
        end
    
        def gateway_card
          ActiveMerchant::Billing::CreditCard.new(
            verification_value: cvv,
            number:             credit_card_number,
            year:               "20#{year}",
            month:              month,
          )
        end
    
        def bill_to
          {
            first_name:         first_name,
            last_name:          last_name,
            #company: ,
            #address1: ,
            #address: ,
            #city: ,
            #state: ,
            #zip: ,
            #country: ,
            #phone_number: ,
            #fax_number: ,
            #customer_address_id: ,
          }
        end
    

    【讨论】:

      猜你喜欢
      • 2013-03-17
      • 2013-12-03
      • 2012-01-04
      • 2016-11-29
      • 2015-04-13
      • 2015-02-26
      • 2015-01-16
      • 1970-01-01
      • 2011-05-15
      相关资源
      最近更新 更多