Answers.Body: <p>I ended up developing a real quick plugin to make an additional call to Paypal to get and store the address to the order.</p>
  
  <p><a href="https://github.com/wojodesign/paypaladdresser" rel="nofollow noreferrer">https://github.com/wojodesign/paypaladdresser</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-31T01:17:18.473Z
Answers.Text: That's great - one does wonder, though, if perhaps Commerce itself shouldn't perhaps deal with it as Paypal customers do routinely use the Paypal facilities for address handling I guess.  Perhaps you should raise this with Luke holder at some point?
Answers.UserDisplayName: Jeremy Daalder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-30T18:42:58.297Z
Answers.LastActivityDate: 2017-05-30T18:42:58.297Z
Answers.UserDisplayName: Stephen McKinney
Answers.Body: <p>Well, after a transaction, you can log the full gateway response etc using this event: <a href="https://craftcommerce.com/docs/events-reference#commerce_transactions.onsavetransaction" rel="nofollow noreferrer">https://craftcommerce.com/docs/events-reference#commerce_transactions.onsavetransaction</a></p>
  
  <p>(See what you can get at/log at <a href="https://craftcommerce.com/docs/transaction-model" rel="nofollow noreferrer">https://craftcommerce.com/docs/transaction-model</a>)</p>
  
  <pre><code>craft()-&gt;on('commerce_transactions.onSaveTransaction', function ($event){
  
        $transaction = $event-&gt;params['transaction'];
        BusinessLogicPlugin::log($transaction-&gt;response);
  
   });
  </code></pre>
  
  <p>...that should hopefully get you started on grabbing the data you need (I presume PayPal returns the address) - and then adding that to the cart at that point.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T15:48:06.440Z
Answers.Text: Thanks for the help, but unfortunately no, Paypal does not return the address. I ended up writing a plugin to make another request to Paypal onSaveTransaction to get the address for the order.  Once this project is finished I'll post the github link here.
Answers.UserDisplayName: Stephen McKinney
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-23T23:16:31.807Z
Answers.Text: Good to know but how odd it doesn't return it initially.  I checked our main gateway and it apparently does, although there's no facility for the customer to change it with the gateway so it's really kinda pointless there other than to check it's receiving what we think it is receiving!
Answers.UserDisplayName: Jeremy Daalder
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-25T20:12:04.567Z
Answers.Text: Well craft commerce hard codes the paypal parameter to hide shipping when it sends the request to paypal. I had to add in a hook to modify the request data to put it back in. I couldn't get paypal to return back the shipping address in the raw gateway response, but commerce will still have the shipping address you sent to paypal stored in the order.
  
  `public function commerce_modifyPaymentRequest($data){
       $data['noShipping'] = 0;
         return $data;
      }`
Answers.UserDisplayName: Stephen McKinney
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-19T00:23:27.550Z
Answers.LastActivityDate: 2017-05-23T06:11:08.787Z
Answers.LastEditDate: 2017-05-23T06:11:08.787Z
Answers.UserDisplayName: Jeremy Daalder
Body: <p>When I checkout via Paypal express if I don't already have an address added to the cart model, when the paypal checkout process returns back there will be no address attached to the order. </p>
  
  <p>The reason I want the address to be sent back afterwards is that i want to send customers to paypal from the cart page so there is no address form prior to leaving to paypal. This flow is something possible on say, woocommerce.</p>
  
Tags: <plugin-craftcommerce><ecommerce>
Title: Can Craft Commerce receive back the address used in paypal express checkout?
ThreadText: # Can Craft Commerce receive back the address used in paypal express checkout?
  
  (Asked by: username_0 on 2017-05-17)
  
  When I checkout via Paypal express if I don't already have an address added to the cart model, when the paypal checkout process returns back there will be no address attached to the order.
  
  The reason I want the address to be sent back afterwards is that i want to send customers to paypal from the cart page so there is no address form prior to leaving to paypal. This flow is something possible on say, woocommerce.
  
  **Tags:** plugin-craftcommerce, ecommerce
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-05-30. Score: 1 | Accepted answer
  
  I ended up developing a real quick plugin to make an additional call to Paypal to get and store the address to the order.
  
  <https://github.com/wojodesign/paypaladdresser>
  
  > **Comments:**
  > **username_1**: That's great - one does wonder, though, if perhaps Commerce itself shouldn't perhaps deal with it as Paypal customers do routinely use the Paypal facilities for address handling I guess.  Perhaps you should raise this with Luke holder at some point?  
  
  ---
  
  ### Answer by username_1 on 2017-05-19. Score: 1
  
  Well, after a transaction, you can log the full gateway response etc using this event: <https://craftcommerce.com/docs/events-reference#commerce_transactions.onsavetransaction>
  
  (See what you can get at/log at <https://craftcommerce.com/docs/transaction-model>)
  
  ```
  craft()->on('commerce_transactions.onSaveTransaction', function ($event){
  
        $transaction = $event->params['transaction'];
        BusinessLogicPlugin::log($transaction->response);
  
   });
  
  ```
  
  ...that should hopefully get you started on grabbing the data you need (I presume PayPal returns the address) - and then adding that to the cart at that point.
  
  > **Comments:**
  > **username_0**: Thanks for the help, but unfortunately no, Paypal does not return the address. I ended up writing a plugin to make another request to Paypal onSaveTransaction to get the address for the order.  Once this project is finished I'll post the github link here.  
  > **username_1**: Good to know but how odd it doesn't return it initially.  I checked our main gateway and it apparently does, although there's no facility for the customer to change it with the gateway so it's really kinda pointless there other than to check it's receiving what we think it is receiving!  
  > **username_0**: Well craft commerce hard codes the paypal parameter to hide shipping when it sends the request to paypal. I had to add in a hook to modify the request data to put it back in. I couldn't get paypal to return back the shipping address in the raw gateway response, but commerce will still have the shipping address you sent to paypal stored in the order.  `public function commerce_modifyPaymentRequest($data){      $data['noShipping'] = 0;        return $data;     }`  
  
  ---
  
  