Skip to main content
Available from Yuno Android SDK 2.24.0 and Yuno Web SDK 1.10.8. Order breakdown, shipping address updates, and shipping method selector turn the Google Pay sheet into an express checkout:
  • Order breakdown: show subtotal, shipping, taxes, and discounts instead of a single total.
  • Shipping address updates: recalculate the order when the customer picks or changes their shipping address, without leaving the sheet.
  • Shipping method selector: let the customer choose Standard, Express, or Same-day on the sheet, with instant price updates.
Each capability is opt-in. If you don’t use them, your Google Pay integration works exactly as before.

Requirements

On Android, upgrading to 2.24.0 is a breaking change.
  • Set minSdkVersion to 23 or higher. With 21 or 22 the build fails at the manifest merge step.
  • If your app pins com.google.android.gms:play-services-wallet below 20.0.0, remove the pin or use 20.0.0 or higher.
  • If you call startCheckout, startPayment, startPaymentLite, startPaymentSeamlessLite, or continuePayment passing every argument by position, update the call: a new optional parameter was added before the last callback. Calls that use named arguments or a trailing lambda need no change.
See the Android SDK changelog for details.
On the Web there are no breaking changes and no page changes: the SDK loads and configures Google Pay for you. If you load a fixed SDK version (for example, with an integrity hash), make sure it is 1.10.8 or newer.

How it works

  1. Your backend adds summary_items and/or shipping_methods when it creates the checkout session.
  2. Your app registers onShippingAddressChanged when it starts the payment flow.
  3. On the Google Pay sheet, switching shipping method updates the price instantly without calling your app. Picking or changing the shipping address calls your handler, so you can return new totals, new methods, or an error.
  4. After the customer authorizes, the one-time token includes a shipping object with the selected method and the full address.
Two rules apply everywhere:
  • Every summary_items list must end with the grand total. Its amount is the total shown on the sheet, and its label is shown next to it (we recommend your store name).
  • All amounts must use the session currency. A different currency makes the SDK ignore that breakdown or response.

Step 1: Show an order breakdown (backend only)

Add summary_items when you create the checkout session:
The sheet now shows an expandable breakdown with the total labeled “ACME Inc.” No app code is needed.
  • The ids subtotal, shipping, tax, and discount use Google’s native line types. Any other id shows as a regular line. The customer only sees your labels.
  • The last entry must be the grand total and must match the session amount (tolerance 0.001 on Android, 0.01 on Web). If it doesn’t, the sheet shows only the total.
  • Discounts can be negative, for example -5.00.
  • Send at least two entries: one line plus the grand total. If the list is invalid (fewer than two entries, missing label or amount, mixed currencies, no total), the sheet shows only the total. Nothing breaks and the customer sees no error.
  • Without a breakdown, the Web SDK labels the amount “Total” in the checkout language (SDK 1.11.17 or newer).
  • When you also send shipping_methods (Step 2) and register the handler, the sheet shows the first method’s breakdown and this list is ignored.

Step 2: Offer shipping methods on the sheet

Add shipping_methods to the checkout session. Each method has its own summary_items, so the sheet can update the price as soon as the customer switches method:
The selector needs the handler from Step 3. Without it, the sheet ignores the methods and works as before.
  • Every method needs a unique id. If two methods share an id, the selector is not shown.
  • The first method is preselected.
  • The price is shown in the option name, for example “$5.00: Standard shipping”. detail is shown as the description.
  • Switching methods never calls your app or your backend. The total comes from that method’s summary_items.
  • Each method’s summary_items must end with that method’s total, which can differ from the session amount. Send at least one line plus the total. A method with only the total shows no breakdown and Google’s default total label.
  • If any method is invalid, the selector is not shown.
  • delivery_estimate ({ "from": "YYYY-MM-DD", "to": "YYYY-MM-DD" }) is accepted, but Google Pay does not display it on Android or on the Web.

Step 3: React to shipping address changes

Register onShippingAddressChanged when you start the flow. Your handler receives the redacted address and answers with new totals, new methods, an error, or nothing to keep the sheet as it is.
The same optional parameter exists in startPayment, startPaymentLite, startPaymentSeamlessLite, and continuePayment. Register it every time you start a flow.

What you receive: ShippingInfo

Before authorization, Google shares only part of the address, which is enough to quote shipping and taxes: Every field can be missing: null on Android, absent on the Web. The full address arrives in the one-time token (Step 4).

What you return: ShippingUpdate

Answer with any combination of these, or with null to keep the sheet as it is. On Android call complete(...); on the Web return the value from the handler.

Rules

To change prices while the selector is shown, return the full shippingMethods list, each method with its own summaryItems. If you return only summaryItems, the total changes, but the next time the customer switches method the sheet goes back to that method’s original breakdown.
An error on the sheet does not block the payment. The customer can still pay, and the token carries the address you rejected. Always validate the address on your server when you create the payment. If a sale must not happen, return no available shipping method for that address.

Step 4: Read the result in the one-time token

After the customer authorizes, the one-time token you receive in callbackOTT (Android) or createPayment (Web) includes a shipping object with the full address and the selected method:
  • method is the one selected on the sheet, or the first one if the customer didn’t change it. Its label is the one you sent, without the price.
  • Empty address fields come back as empty strings on Android and are left out on the Web.
  • summary_items are not sent back.
  • If you don’t register a handler, the token doesn’t include shipping.
Use this object on your server to charge the final amount, validate the address, and ship the order.

What happens in each case

Good to know

  • The addresses belong to the customer’s Google account. In Google Pay’s TEST environment you’ll only see Google’s test addresses; you can’t add your own.
  • The sheet asks for a shipping address as soon as the handler is registered. Without a handler, it only asks when the shipping address is enabled as a required field in the Checkout Builder.
  • The selected method stays selected when the customer changes the address, unless you return new methods.
  • Privacy: the SDK never logs addresses, emails, or payment data.
  • Google Pay Pix (Brazil) is not affected.

Troubleshooting