# Paypal address problems with active\_merchant

**URL:** <https://www.ruby-forum.com/t/paypal-address-problems-with-active-merchant/115302>\
**Category:** Rails\
**Created:** [September 23, 2007, 2:27pm UTC](https://www.ruby-forum.com/t/paypal-address-problems-with-active-merchant/115302 "2007-09-23T14:27:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gga](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@gga](https://www.ruby-forum.com/u/gga)\
**Post date:** [September 23, 2007, 2:27pm UTC](https://www.ruby-forum.com/t/paypal-address-problems-with-active-merchant/115302/1 "2007-09-23T14:27:23Z")

</div>

Hi. New to rails and active\_merchant. I’m currently testing my  
shopping cart with paypal sandbox and it’s kind of working but not  
quite.

Besides the credit card stuff, I’m also filling most parameters for  
buyer information.

However, I am getting a bad response from paypal saying:

“There’s an error with this transaction. Please enter a complete  
shipping address.”

I’ve dumped the buyer information I am passing to the gateway  
authorize function, which when the error occurs would be equivalent to  
this:

# … snip … money and creditcard

gateway = ActiveMerchant::Billing::PaypalGateway.new(  
:login =\>  
PAYPAL\_LOGIN,  
:password =\>  
PAYPAL\_PASS  
)

buyer = {  
:email=\>“removed\_email\_address@domain.invalid”,  
:address=\>{:phone=\>“4943-2134”,  
:address1=\>“Main Ave. 414”,  
:address2=\>"",  
:city=\>“Fresno”,  
:state=\>“California”,  
:country=\>“US”,  
:zip=\>“90063”},  
:description=\>“Software”,  
:order\_id=\>4,  
:ip=\>“201.243.52.221”  
}

response = gateway.authorize( money, creditcard, buyer )

and quite frankly, I cannot see anything wrong other than an obvious  
fake address. I’ve also tried sending two letter states and full  
country names with no improvement.

Does anyone have any idea what to try? The paypal error response is  
anything but useful. I’ve looked into the active\_merchant paypal  
gateway and the address gets copied to shipping address using some  
weird xml keys, so not sure what paypal complains about. I was unable  
to find docs about the paypal xml that active merchant uses.
