x

Associate Order with Apple Pay transaction

Hi, I followed the instructions here - https://developer.squareup.com/docs/payment-form/add-digital-wallets/apple-pay - to add an Apple Pay form on our site.  This allows a user to donate a custom amount to our organization.  I need to associate the donation transaction to an item in Square.  I created the Item in the Square Dashboard and created an Order using the Orders API.  I pass the new Order ID into the Apple Pay transaction, in the order_id field.  The transaction is successful but the response that comes back has a different Order id in the order_id field.  Also, I see the donation transaction in the Dashboard but I don't see the Order in the Dashboard.  And the transaction is not associated with the item in the order.  Please advise.

1,844 Views
Message 1 of 10
Report
9 REPLIES 9
Alumni

Can you please provide the payment_id so we can look into this, @lrmpham?

It sounds like you're going about this the correct way, but may be passing the order incorrectly. You should be calling CreatePayment and passing the order_id as a parameter. I hope this helps!

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,795 Views
Message 2 of 10
Report

Thanks for the reply.  I added the order_id to the CreatePayment request and is still getting the same result.  The payment id from the process payment call is - nBxvPHzrhAY4mNJ0ADbfjcLOHfXZY

There is an order_id associated with this payment but it is not the same as the order_id that I passed in to the CreatePayment request (from the createPaymentRequest callback).

1,790 Views
Message 3 of 10
Report
Alumni

Our API specialist was able to confirm that you did not pass in an order_id into the request. If you think you are passing an order_id, can you please share a code snippet of the request (without access tokens)? Thanks in advance, @lrmpham!

This is all we see for the request in the logs:

request=source_id: "[FILTERED]" idempotency_key: "4a72d7b20dd60b70d1c8ac812ada328cb05f4612f562" amount_money { amount: 100 currency: USD }

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,771 Views
Message 4 of 10
Report

Ok, I made the change in where to pass the order_id and the payment object that comes back 

(id - PB1WjZotw8hw65sB1KeWId1rQMFZY) now has the same order_id (8KLkhKiwyIHHOK2Q8RsQRkL6ZqeZY) as the one I pass. 

However I still don't see this order in my Square dashboard. 

1,752 Views
Message 5 of 10
Report
Alumni

I was able to get a bit more information from our API specialists, @lrmpham.
In order for an order to show up in your Square Dashboard, it needs:

  1. To be paid for (it sounds like this was done)
  2. To have a fulfillment associated with it

For an example, head to this page.

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,735 Views
Message 6 of 10
Report

@Valentina This transaction is a donation so there really isn't any fulfillment.  I attached an Order to it in order to associate it with an item so I can see all transactions for this item.  Is this possible without going through the Fulfillment process ?  Here is a snipet of the Order object:

"id": "8KLkhKiwyIHHOK2Q8RsQRkL6ZqeZY",
      "location_id": "XXXXXXXXXXX",
      "line_items": [
        {
          "uid": "ZoRknFgd2xUhl4vKHjlf0D",
          "catalog_object_id": "6UAJKYFTKSGUSMIKRULIBIB4",
          "quantity": "1",
          "name": "Test Donation Item",
          "variation_name": "Regular",
1,731 Views
Message 7 of 10
Report
Alumni

You cannot see an order in the Dashboard unless you supply a fulfillment, @lrmpham.

You can definitely still use the order, and look it up via the API, but the order itself will not show up in the Orders tab. Once you pay for it, the transaction will show up in the Transactions tab in the Dashboard - so that may work, depending on what you need.

If you want to see this payment in your Dashboard as an actual order, you will need to apply a fulfillment type. If you do not need a fulfillment type, this is fine, you just will not see the order separately. The order view is mainly for fulfilling an order, which is not a relevant for donation.

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,724 Views
Message 8 of 10
Report

@Valentina I realize that I cannot see the Order if there is no fulfillment.  What I wanted to ask was since the Order is associated with an Item, is there a way to see the transaction be associated with that Item ?

1,715 Views
Message 9 of 10
Report
Alumni

Relaying one last bit of help from our API specialist, @lrmpham:

If you attach an order to a payment via API, when you click on the transaction in your Dashboard - yes, it will show the items on it.

Valentina
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
1,709 Views
Message 10 of 10
Report