Set total amount and item name

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”.

I am using heroku for my CHARGE_SERVER_HOST (

Hi @milind169 welcome to the forums!

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 ( You would need to change this functionality to handle whatever amount/item(s) you like.

1 Like

Thanks @sjosey for reply… implemented as suggested,resolved my issue.

one more thing how can i get transaction id using android sdk in successful card payment callback.

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).

1 Like

@sjosey Thanks again.

1 Like