Reader SDK Quick Start

Step 4: Customize the Checkout amount

Before trying a credit card transaction, try updating the sample code to change the checkout amount.

Android

  1. Open ./app/src/main/java/com/example/readersdk/CheckoutActivity.java in the sample app.
  2. In the onCreate() method, change the value of checkoutAmount from 1 USD to 2 USD. As with other Square solutions, Reader SDK specifies monetary amounts in the smallest currency unit of the associated currency code, so 2 USD is specified as 200 cents:
Money checkoutAmount = new Money(200, CurrencyCode.current());
  1. Rebuild the sample app.
  2. Tap the "Charge $2.00" button to complete a new cash transaction.
  3. View the transaction details in Square Dashboard.

iOS

  1. Open ./ReaderSDKSample/Screens/PayViewController.swift in the sample app.
  2. In the PayViewController class, change the value of the amount property from 1 USD to 2 USD. As with other Square solutions, Reader SDK specifies monetary amounts in the smallest currency unit of the associated currency code, so 2 USD is specified as 200 cents:
private let amount = 200
  1. Rebuild the sample app.
  2. Tap the "Charge $2.00" button to complete a new cash transaction.
  3. View the transaction details in Square Dashboard.
Prev
< Take a cash payment
Next
Take a credit card payment >

Ask for help on Stack Overflow or join our Slack channel