Skip to main content
Available from Yuno iOS SDK 2.24.0 and Yuno Web SDK 1.10.8. Order breakdown, shipping address updates, and a shipping method selector turn the Apple 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 Apple Pay integration works exactly as before.

Requirements

How it works

  1. Your backend adds summary_items and/or shipping_methods when it creates the checkout session.
  2. Your app registers onShippingAddressChanged: on iOS on the delegate it already passes to the payment flow, on the Web in externalButtons when it starts the checkout.
  3. On the Apple 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 as the payee line (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 the breakdown with the total labeled “ACME Inc.”. No app code is needed.
  • The last entry is displayed as the grand total and its label as the payee line.
  • Discounts can be negative, for example -5.00.
  • When you also send shipping_methods (Step 2), the sheet opens with the first method’s breakdown and this list is ignored.
  • Without summary_items and without shipping_methods, the sheet shows a single line with the session amount.

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 first method is preselected and its breakdown is the one the sheet opens with.
  • label is the option name and detail its description. Apple Pay shows the price next to the option.
  • Switching methods never calls your app or your backend. The total comes from that method’s summary_items. A method without a breakdown keeps the totals already on the sheet.
  • delivery_estimate is a from and to pair of YYYY-MM-DD dates. It is rendered as a date range next to the option on iOS 15 and later, and on the Web on browsers that support Apple Pay JS version 12 (Safari 15 and later). A reversed or malformed range is not shown.
  • The sheet accepts up to 100 methods, 100 summary items, and 100 items per method. Above that, the iOS SDK opens the sheet without shipping methods, and the Web SDK does not open the sheet and reports an error.

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.
Conform the delegate you already pass to the payment flow to YunoShippingDelegate and implement onShippingAddressChanged. It works with every flow that takes a YunoPaymentDelegate: startCheckout, startPaymentLite, and the payment methods list of Full mode.
If you don’t use async, or you integrate from Objective-C, implement the completion-based variant that YunoPaymentDelegate declares as optional instead:
Implement one of the two. When both exist, the SDK calls the async one.

What you receive: ShippingInfo

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

What you return: ShippingUpdate

Return any combination of these, or nil (null on the Web) to keep the sheet as it is.

Rules

Unlike Google Pay, an error on the Apple Pay sheet does block the payment: the customer has to pick another address before paying. Still validate the address on your server when you create the payment.

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

After the customer authorizes, the one-time token you receive in yunoCreatePayment includes a shipping object with the selected method and the full address:
  • method is the one selected on the sheet, or the first one if the customer didn’t change it.
  • summary_items are not sent back.
  • The object is included whenever the sheet collected a shipping method or an address, with or without a handler. Payments without either don’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

  • On iOS, Apple Pay is not supported in the iOS Simulator. Test on a physical device. On the Web, test in Safari on a device with Apple Pay set up.
  • Apple Pay redacts the address until the payment is authorized, so your handler never sees street lines.
  • 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.

Troubleshooting