Skip to main content
Available from Yuno iOS SDK 2.24.0. 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 implements onShippingAddressChanged on the delegate it already passes to the payment flow.
  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. On iOS 15 and later it is rendered as a date range next to the option. 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 SDK opens the sheet without shipping methods.

Step 3: React to shipping address changes

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: YunoShippingInfo

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

What you return: YunoShippingUpdate

Return any combination of these, or nil 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

  • Apple Pay is not supported in the iOS Simulator. Test on a physical device.
  • 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.

Testing checklist

  1. Upgrade to SDK 2.24.0 or newer and build.
  2. Create a session with summary_items only. The sheet shows the breakdown and the right total.
  3. Create a session with shipping_methods. The sheet shows the selector with the first method selected and asks for a shipping address.
  4. Switch methods. The price updates and your handler is not called.
  5. Implement the handler and change the address. Your handler receives it; return new totals and check the sheet updates.
  6. Return an error for an address you don’t serve. The sheet shows your message and the customer cannot pay until they pick another address.
  7. Authorize. The token includes shipping with the method and the full address.
  8. Remove the handler and the session fields. Everything works as before.

Troubleshooting