I am implementing Android In-App Payments SDK for my app.
I have downloaded github demo cookies project and ran it successfully.
but did not find any option (in CardEntry class or any other class) to set total amount and change item name using credit cards.
it’s alway taking amount “$1” and item name “Cookies”.
The amount is not set by the In-App Payments SDK. The SDK only generates a nonce to be used with CreatePayment. In the example Heroku app, you can see we create an order with an item called “Cookies” for $1.00 (https://github.com/square/in-app-payments-server-quickstart/blob/master/index.js#L117). You would need to change this functionality to handle whatever amount/item(s) you like.
The CreatePayment response on the server will include the payment_id (as well as the entire Payment object). It will also include the order_id which can be used to retrieve itemized information in the Orders API; the order_id is also equal to the transaction_id, if you’re really looking for that (which the Transactions API is now deprecated, so we recommend using Payments API).