Search code examples
squaresquare-connect

How to REQUEST_METADATA from Square?


I'm making a call to Square using web api Android. The response of the transaction gives me CLIENT_TRANSACTION_ID. I want to know other information like transaction amount and the change as well as I can see in receipt email. I can't see how to give S.com.squareup.register.REQUEST_METADATA a value while firing an intent so that i can have S.com.squareup.register.RESULT_REQUEST_METADATA in response. Also what are the optional values we can give to square api against this key. The code is below

<a href="intent:#Intent;action=com.squareup.register.action.CHARGE;package=com.squareup;S.browser_fallback_url=https://2f857915.ngrok.io/square_callback;S.com.squareup.register.WEB_CALLBACK_URI=https://2f857915.ngrok.io/square_callback;S.com.squareup.register.CLIENT_ID=sq0idp-6Lo2W9zX8K9b08zKxmfUtw;S.com.squareup.register.API_VERSION=v1.3;i.com.squareup.register.TOTAL_AMOUNT=100;S.com.squareup.register.CURRENCY_CODE=USD;S.com.squareup.register.TENDER_TYPES=com.squareup.register.TENDER_CARD,com.squareup.register.TENDER_CARD_ON_FILE,com.squareup.register.TENDER_CASH,com.squareup.register.TENDER_OTHER;end;">Charge With Square</a>

I want to have information about this payment so that can be used in my application. For example payment done, payment currency, taxes etc.


Solution

  • You'll need to use the Retrieve Transaction endpoint to turn that ID into additional information. Note, you should only get CLIENT_TRANSACTION_ID if you do not process a card, and if you process a card payment, you should get back a SERVER_TRANSACTION_ID