I'm trying to perform refund using AIM api and failed due to lack of documentation. I have no idea what is the right way to pass Card Number and Transaction ID.
request = AuthorizeNet::AIM::Transaction.new(
AUTHORIZE_NET_CONFIG["api_login_id"],
AUTHORIZE_NET_CONFIG["api_transaction_key"], {
:transaction_type => AuthorizeNet::AIM::Transaction::Type::CREDIT,
:gateway => (Rails.env.production? ? :live : :test),
:test => !Rails.env.production?
}
)
07-25-2012 01:49 AM - edited 07-25-2012 01:50 AM
I have only last 4 digits of CC number.
result.fields[:card_num] = '1111'
result.fields[:transaction_id] = payment.transaction_id
result.run
result.response.fields[:response_reason_text] #=> "(TESTMODE) The credit card number is invalid."
07-25-2012 02:09 AM
the card number should be as masked cc# like "XXXX1111"
07-25-2012 04:43 AM