Reputation: 14630
The UI on Authorize.net clearly has a place for name and address information, which I can add/edit manually.
But I can't figure out how to add name information with the card
according to:
But The Active Merchant source file doesn't seem to use anything but the card number, expiration date and card code, and the name info on the card is not sent over to Authorize.net.
Does anyone know how to do this?
Upvotes: 1
Views: 44
Reputation: 14630
Ok, for posterity this is solved, use 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
Upvotes: 1