Shopify/active_merchant — Issue #278: Securepay test url
Author: ma2tdu59
Created: 2012-02-24 05:15:59+00:00
State: open

Hi,

I'm using activemerchant for a securepay gateway in my rails app. I use that code :

ActiveMerchant::Billing::Base.mode = :test

credit_card = ActiveMerchant::Billing::CreditCard.new(
:first_name => 'Bob',
:last_name => 'Bobsen',
:number => '4444333322221111',
:month => 10,
:year => 2015,
:verification_value => '123',
:type	=> 'visa'
)

options = {
:order_id => '1230123',
:email => 'bob@testbob.com',
:address => { :address1 => 'Level 1/224 Swan St',
:address2=>"",
:city => 'Richmond',
:state => 'Victoria',
:zip => '3121',
:country => 'AU'
},
:description => 'purchased items'
}

#Validating the card automatically detects the card type
if credit_card.valid?
gateway = ActiveMerchant::Billing::SecurePayGateway.new(:login => 'ABC0001',:password => 'abc123')
response = gateway.purchase(1000, credit_card, options)
p response

if response.success?
gateway.capture(1000, response.authorization)
puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"

end
end

Each time, i got this response : AVS data is invalid or AVS is not allowed for this card type.

That's why I called Securepay and they told me the url used for test is wrong and is actually :

https://test.securepay.com.au/xmlapi/payment

Can you tell more on that ? Do I got something wrong ?

Thanks in advance,

Matt