Support

Home Forums Event Espresso Premium PayPal Payments Pro Shipping Address

PayPal Payments Pro Shipping Address

Posted: July 1, 2013 at 6:16 pm


joelw

July 1, 2013 at 6:16 pm

Hello – we are using PayPal Payments Pro for our credit card processing. We also ship materials to our students when they register for an event. We typically print our shipping labels directly from PayPal. However, since we moved to EE we have not been able to do this because PayPal is for some reason, not capturing the Shipping information. I searched the documentation and found a “Shipping Address” option for PayPal mentioned, but I don’t see an option like that in the PayPal Payments Pro Settings on the Payment Settings page in EE. Is there somewhere we are supposed to turn this option on so the shipping address is transferred to PayPal? Thanks!


Sidney Harrell

July 1, 2013 at 8:17 pm

Normally, our customers are dealing in tickets, so by default the shipping information is left blank in the transaction with Paypal. However, the fields are there in the files in the Paypal pro gateway directory. (If you would like us to modify the file and email it to you, please let us know.) First you’ll want to make a copy of the folder plugins/event-espresso/gateways/paypal_pro and place it in uploads/espresso/gateways, so that your modification will not be overwritten the next time you update Event Espresso. Then open the file DoDirectPayment.php and look at around line 70:

$ShippingAddress = array(
				'shiptoname' => '', // Required if shipping is included.  Person's name associated with this address.  32 char max.
				'shiptostreet' => '', // Required if shipping is included.  First street address.  100 char max.
				'shiptostreet2' => '', // Second street address.  100 char max.
				'shiptocity' => '', // Required if shipping is included.  Name of city.  40 char max.
				'shiptostate' => '', // Required if shipping is included.  Name of state or province.  40 char max.
				'shiptozip' => '', // Required if shipping is included.  Postal code of shipping address.  20 char max.
				'shiptocountrycode' => '', // Required if shipping is included.  Country code of shipping address.  2 char max.
				'shiptophonenum' => '' // Phone number for shipping address.  20 char max.
		);

You’ll want to change it so that it uses the information submitted as the section right above it does:

$ShippingAddress = array(
				'shiptoname' => $_POST['first_name'] . ' ' . $_POST['last_name'], // Required if shipping is included.  Person's name associated with this address.  32 char max.
				'shiptostreet' => $_POST['address'], // Required if shipping is included.  First street address.  100 char max.
				'shiptostreet2' => '', // Second street address.  100 char max.
				'shiptocity' => $_POST['city'], // Required if shipping is included.  Name of city.  40 char max.
				'shiptostate' => $_POST['state'], // Required if shipping is included.  Name of state or province.  40 char max.
				'shiptozip' => $_POST['zip'], // Required if shipping is included.  Postal code of shipping address.  20 char max.
				'shiptocountrycode' => 'US', // Required if shipping is included.  Country code of shipping address.  2 char max.
				'shiptophonenum' => empty($_POST['phone']) ? '' : $_POST['phone'] // Phone number for shipping address.  20 char max.
		);


joelw

July 4, 2013 at 11:13 am

Thanks Sidney! Can I take you up on the offer to modify the file and email it to me? Thanks again!


Sidney Harrell

July 10, 2013 at 11:06 am

Emailed the file to you.


joelw

July 17, 2013 at 4:01 pm

Hi Sidney,

Got the file (thank you!) and followed your instructions, but still nothing passing through to PayPal. Any ideas what might be wrong?

Joel


Chris Hardcastle

July 25, 2013 at 10:44 pm

Good Evening.

I am having the same issue. I would like the shipping information passed through to PayPal Payments Pro (Canadian). Can you send me the information I need to do this as well.

Thanks


Chris Hardcastle

July 25, 2013 at 11:10 pm

I just followed the instructions above and teh information is not passing through to paypal. Do you have any updates?


Sidney Harrell

July 26, 2013 at 5:09 pm

Yes, I followed up with joelw over email, but on the first pass, I missed that the shipping details were not getting added to the array that gets passed to the PayPal library object. Starting on line 105 of DoDirectPayment.php it should be changed to:

$PayPalRequestData = array(
			'DPFields' => $DPFields,
			'CCDetails' => $CCDetails,
			'PayerName' => $PayerName,
			'BillingAddress' => $BillingAddress,
			'PaymentDetails' => $PaymentDetails,
			'OrderItems' => $OrderItems,
			'ShippingAddress' => $ShippingAddress
	);


Chris Hardcastle

July 26, 2013 at 6:55 pm

This fixed it.

Thanks for your help.


joelw

July 29, 2013 at 12:33 pm

Hi Sidney – not sure if you saw my email, but we are still having a bit of a problem – the code you supplied does transfer an address to PayPal, so we’re one step closer, but unfortunately, it transfers the customer’s billing address, not their shipping address. We attempted to setup EE to capture both, as we need both but I’m not sure if we’ve done something wrong in our setup, or if your code would need to be modified to pickup the shipping rather than billing address?


Josh

  • Support Staff

August 14, 2013 at 1:55 pm

Event Espresso has one set of Address fields which is what Sidney’s suggested modifications use to send to PayPal. If you need to add a second set of address fields (for billing) that do not get sent to PayPal you can add them to a custom question group and label the group as “Billing Address”.

The support post ‘PayPal Payments Pro Shipping Address’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso