Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getShippingAddress() Method in Payment Model returns NULL #19

Closed
Hackinet opened this issue Aug 1, 2020 · 2 comments
Closed

getShippingAddress() Method in Payment Model returns NULL #19

Hackinet opened this issue Aug 1, 2020 · 2 comments

Comments

@Hackinet
Copy link

Hackinet commented Aug 1, 2020

I create a checkout Object and put setAskForShippingAddress() to true, and it does indeed collect shipping address during the hosted checkout.

However, the API Docs do not specify as to how to fetch that back. The $api_response = $client->getCheckoutApi()->createCheckout('$location_id', $checkout_data_body) does not return it. Your payment.updated webhook does not send back the shipping address either on payment completion (I do however get the payment_id and order_id, but neither the Payment or Order API contain the shipping address).

How do get the shipping address filled by customer during the hosted checkout?

UPDATE

I was going through the Models and the Payment model does have a method but it returns NULL. This is the var_dump() snippet of $apiResponse = $paymentsApi->getPayment($paymentId):

      ["referenceId":"Square\Models\Payment":private]=>
      NULL
      ["customerId":"Square\Models\Payment":private]=>
      NULL
      ["employeeId":"Square\Models\Payment":private]=>
      NULL
      ["refundIds":"Square\Models\Payment":private]=>
      NULL
      ["buyerEmailAddress":"Square\Models\Payment":private]=>
      NULL
      ["billingAddress":"Square\Models\Payment":private]=>
      NULL
      ["shippingAddress":"Square\Models\Payment":private]=>

This is still an issue. Help.

@Hackinet Hackinet changed the title No method to get shipping address from checkout getShippingAddress() Method in Payment Model returns NULL Aug 1, 2020
@StephenJosey
Copy link

When using the Checkout API, the shipping address will be added to the customer's address, not part of the payment/order. You can retrieve the payment and get the customer_id, and retrieve the customer using RetrieveCustomer, and the address should be there. Let me know if you find that to not be true, or if you have further questions.

@sseaman
Copy link
Collaborator

sseaman commented Sep 1, 2020

Closing as no additional questions posted. Please feel free to reopen if you need to.

@sseaman sseaman closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants