简体   繁体   中英

how to pass the amount to pay and how to get transaction_id in in-app-payments sdk?

I am new to square payment. I want to integrate square payment gateway in my Android app. I tried the in-app-payments-sdk. But I couldn't find how to pass the amount to pay and how to get transaction_id in in-app-payments sdk. I am only able to input card details and getting a "nonce" in OnActivityResult. Do I have to use other APIs like Orders API or Payments API? Please help.

Yes you do. Once you get the nonce:

The simplest way is to call the Payment api

  1. Call the payment api or equivalent from Android SDK https://developer.squareup.com/reference/square/payments-api/create-payment source_id is your nonce

Alternatively,

  1. You can create an order using https://developer.squareup.com/reference/square/orders-api/create-order

Then you can use that order_id to make a payment from step 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM