cancel
Showing results for 
Search instead for 
Did you mean: 

How to perform CREDIT transaction using ruby AIM api?

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?
  }
)

 

bolshakov
Member
2 REPLIES 2

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."

bolshakov
Member

the card number should be as masked cc#  like "XXXX1111"