# ActiveMerchant throws an invalid transaction error

**URL:** <https://www.ruby-forum.com/t/activemerchant-throws-an-invalid-transaction-error/176671>\
**Category:** Rails\
**Created:** [October 4, 2009, 4:30pm UTC](https://www.ruby-forum.com/t/activemerchant-throws-an-invalid-transaction-error/176671 "2009-10-04T16:30:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f19dbf/32.png) [@siddharth](https://www.ruby-forum.com/u/siddharth)\
**Post date:** [October 4, 2009, 4:30pm UTC](https://www.ruby-forum.com/t/activemerchant-throws-an-invalid-transaction-error/176671/1 "2009-10-04T16:30:09Z")

</div>

I am trying to incorporate ExpressCheckout with Paypal using Active  
Merchant and when I click on the express checkout button it takes me to  
the paypal site and gives me an error that says Invalid transaction  
error please use the …

I notice that the error log does not generate a token at the time of  
sending the request and it looks something like this

[https://www.paypal.com/cgibin/webscr?cmd=\_express-checkout&token=](https://www.paypal.com/cgibin/webscr?cmd=_express-checkout&token=)

So i feel that the error lies there but I may be wrong.

I have a setup a paypal account and a buyer seller accounts are in  
place.

My Controller looks like this

def express  
cart = find\_cart  
price = cart.get\_price\_in\_cents  
response= EXPRESS\_GATEWAY.setup\_purchase(price,  
{:ip=\>request.remote\_ip, :return\_url=\>new\_orders\_url,  
:cancel\_return\_url=\>“[http://localhost:3000/search/home](http://localhost:3000/search/home)”})  
redirect\_to EXPRESS\_GATEWAY.redirect\_url\_for(response.token)  
end

I would appreciate any kind of help with this.

Thanks
