Skip to content

Commit

Permalink
Carry over entered phone number and notes from shipping address for p…
Browse files Browse the repository at this point in the history
…aypal express payment
  • Loading branch information
Nick Albright committed Mar 17, 2016
1 parent d2df3d5 commit 1f70b50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions paypal/express/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ def get_shipping_address(self, basket):
Return a created shipping address instance, created using
the data returned by PayPal.
"""
# nla - To pull over the phone number/notes from the entered address
old_shipping = super( SuccessResponseView, self).get_shipping_address( basket )

# Determine names - PayPal uses a single field
ship_to_name = self.txn.value('PAYMENTREQUEST_0_SHIPTONAME')
if ship_to_name is None:
Expand All @@ -357,6 +360,9 @@ def get_shipping_address(self, basket):
line4=self.txn.value('PAYMENTREQUEST_0_SHIPTOCITY', default=""),
state=self.txn.value('PAYMENTREQUEST_0_SHIPTOSTATE', default=""),
postcode=self.txn.value('PAYMENTREQUEST_0_SHIPTOZIP', default=""),
# nla - Move over notes and phone numbers that don't come thru PP
phone_number=old_shipping and old_shipping.phone_number or "",
notes=old_shipping and old_shipping.notes or "",
country=Country.objects.get(iso_3166_1_a2=self.txn.value('PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'))
)

Expand Down

2 comments on commit 1f70b50

@ershadul
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has saved my life today. I urge to merge this change with master branch if not done already.

@aesdev
Copy link
Collaborator

@aesdev aesdev commented on 1f70b50 May 30, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.