How can I test Paypal Express with ActiveMerchant in a Rails 3.2 app with rspec/capybara integration test?
Asked
Active
Viewed 768 times
5
-
http://www.codyfauser.com/2008/1/17/paypal-express-payments-with-activemerchant ? – KennyPowers Jan 30 '13 at 09:25
-
@RobZolkos did you manage to achieve this? I'm trying to do it now, not sure how. – Adam Waite Jul 22 '13 at 22:36
-
Unfortunately, this URL no longer exists. Any hints to where to find docs or a tutorial on rspec'ing active_merchant's paypal express gateway would be very helpful! – Anthony Liekens Apr 15 '14 at 14:32
1 Answers
1
You can test by setting:
ActiveMerchant::Billing::Base.mode = :test
PayPal however will require you to enter complete billing information or the API won't even accept it and will return:
Error: There's an error with this transaction. Please enter a complete billing address.
In which case you can supply it with some generic info:
:billing_address => {
:name => "Test Person",
:address1 => "123 W 423 E",
:city => "Somewhere",
:state => "CA",
:country => "US",
:zip => "88888"
}

sjain
- 23,126
- 28
- 107
- 185
-
2I'm aware of how to activate test mode with the gateway. My question was how I write an automated integration test with rspec/capybara. – robzolkos Jan 30 '13 at 12:37