I created a developer account with authorize.net and I am trying to create a customer profile via activemerchant.
> GATEWAY.create_customer_profile(:profile => { :merchant_customer_id => "123foobar", :email => "[email protected]" })
#<ActiveMerchant::Billing::Response:0x007fc3a2663e20 @params={"messages"=>
{"result_code"=>"Error", "message"=>{"code"=>"E00007", "text"=>"User authentication failed
due to invalid authentication values."}}}, @message="User authentication failed due to
invalid authentication values.", @success=false, @test=false, @authorization=nil,
@fraud_review=nil,
@avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil},
@cvv_result={"code"=>nil, "message"=>nil}>
I looked up that error code and it says:
API Error Code: E00007
Error Code Text: User authentication failed due to invalid authentication values.
Description: The name/and or transaction key is invalid.
Other Tips: Try switching between production and developer test URL's. The test URL
requires a separate developer test account, which can be set up by filling out the following form: http://developer.authorize.net/testaccount.
Just to be certain, I verified the api login key.. When I inspect the gateway object, I see the login (api login key), password (transaction key), and :test => true
Can anyone tell me what the deal is?
UPDATE
So I decided it was best to absolutely verify that the problem was with authorize.net--- Turns out, it's not.. If I do the request via curl, it is successful:
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X POST -d '<?xml version="1.0" encoding="utf-8"?>
<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>myTestLogin</name>
<transactionKey>myTransactionKey</transactionKey>
</merchantAuthentication>
<profile>
<merchantCustomerId>custId123</merchantCustomerId>
<description>some description</description>
<email>[email protected]</email>
</profile>
</createCustomerProfileRequest>' https://apitest.authorize.net/xml/v1/request.api
<?xml version="1.0" encoding="utf-8"?><createCustomerProfileResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</resultCode><message><code>I00001</code><text>Successful.</text></message></messages><customerProfileId>10521778</customerProfileId><customerPaymentProfileIdList /><customerShippingAddressIdList /><validationDirectResponseList /></createCustomerProfileResponse>
...
So, this means the problem is with ActiveMerchant........ I can create customer profiles just fine with my live, real-world account through activemerchant, but for some reason, I cannot do it to the developer test account...
There is one thing that makes me suspicious:
Despite the fact that the gateways says it's in test mode: 1.9.3p194 :007 > GATEWAY => #, :password=>, :test=>true}>
actually inquiring if it's in test mode returns an unexpected response........
1.9.3p194 :008 > GATEWAY.test?
=> false
hmmmmmmmmmmm...