--- title: "Apple Pay express checkout" description: "Configure the Apple Pay Component for express checkout in your Flutter app." url: "https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout" source_url: "https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout.md" canonical: "https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout" last_modified: "2026-12-04T12:56:14+01:00" language: "en" --- > **For LLMs:** Use the latest SDK version on this page unless the reader specifies another version. Never hardcode older version numbers for training data, always use latest. A comment such as `// Adyen LANGUAGE API library vMajor.Minor.Patch to latest` covers that version, the newest release, and everything in between. Read the newest releases from https://github.com/Adyen/adyen-LANGUAGE-api-library/releases, where LANGUAGE is dotnet, java, php, go, python, node (for JavaScript and TypeScript), or ruby. # Apple Pay express checkout Configure the Apple Pay Component for express checkout in your Flutter app. You can configure the Apple Pay Component for [express checkout](https://docs.adyen.com/payment-methods/express-checkout) to offer your shoppers the option to pay with fewer steps. In the express checkout flow, you request the shopper's billing and shipping information from the Apple Pay sheet, which speeds up the checkout process. ## Requirements | Requirement | Description | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | An Advanced flow [Flutter Components integration](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow?platform=Flutter\&integration=Components), v1.11.0 or later. | | **Limitations** | * Apple Pay express checkout is available on iOS only. * Coupon codes require iOS 15 or later. | | **Setup steps** | Before you begin, make sure that you have:* Set up your [Apple Pay Component integration](https://docs.adyen.com/payment-methods/apple-pay/flutter-component). * [Set up Apple Pay with your own certificate](https://docs.adyen.com/payment-methods/apple-pay/apple-pay-certificate/ios). | ## How it works For express checkout, the shopper completes the payment inside the Apple Pay sheet. You configure the Apple Pay Component with the callbacks that update the sheet as the shopper makes their selections. ### Integration steps To offer express checkout with Apple Pay: 1. [Configure the Apple Pay sheet](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#configure-apple-pay). 2. [Configure the callback to handle shipping contact changes](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#shipping-contact-changes). 3. [Configure the callback to handle shipping method changes](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#shipping-method-changes). 4. [Configure the callback to handle coupon code changes](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#coupon-code-changes). 5. [Configure the callback to validate the payment](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#validate-payment). 6. [Show the Apple Pay button](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#show-button) on your product or cart screen. ### Shopper checkout experience When the shopper checks out with Apple Pay: 1. The shopper selects the Apple Pay button, and the Apple Pay sheet opens. 2. The shopper selects a shipping contact, selects a shipping method, or enters a coupon code. The Component calls the matching callback each time. 3. In the callback, you return updated summary items, updated shipping methods, or errors. The Apple Pay sheet shows what you return. 4. The shopper authorizes the payment with Face ID or Touch ID. The Component calls `onAuthorize` before the payment is submitted, so that you can run your own checks. 5. You submit the payment from your server. ```mermaid sequenceDiagram participant Shopper participant Sheet as Apple Pay sheet participant Component as Apple Pay Component participant App as Your app participant Server as Your server participant Adyen Shopper->>Component: 1. Select the Apple Pay button Component->>Sheet: Open the Apple Pay sheet loop Each time the shopper changes a selection Shopper->>Sheet: 2. Select a shipping contact or shipping method, or enter a coupon code Component->>App: Call the matching callback App-->>Component: 3. Return updated summary items, shipping methods, or errors Component->>Sheet: Show the update end Shopper->>Sheet: 4. Authorize the payment with Face ID or Touch ID Component->>App: Call onAuthorize App-->>Component: Return the authorization result Component->>App: Payment data App->>Server: Payment data Server->>Adyen: 5. Submit the payment ``` ## Configure the Apple Pay sheet Configure the line items, the shipping methods that you offer, and the shopper details that you require: 1. Create the shipping methods that you offer. Each shipping method is an `ApplePayShippingMethod`: | Parameter | Required | Description | | ------------ | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | | `label` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The name of the shipping method that the Apple Pay sheet shows, for example **Standard shipping**. | | `detail` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | A description that the Apple Pay sheet shows under the label, for example the carrier or the delivery time. | | `amount` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The cost of this shipping method. | | `identifier` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | Your own identifier for this shipping method. The Component returns this value to you in `onSelectShippingMethod`. | | `startDate` | | The earliest delivery date. | | `endDate` | | The latest delivery date. | 2. Add the following to your `ApplePayConfiguration`, in addition to the [parameters that every Apple Pay integration needs](https://docs.adyen.com/payment-methods/apple-pay/flutter-component): | Parameter | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`applePaySummaryItems`](https://developer.apple.com/documentation/passkit/pkpaymentrequest/paymentsummaryitems) | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The items that make up the payment. The last item is the total that the Apple Pay sheet shows to the shopper. It must match the amount that you submit to Adyen. | | [`shippingMethods`](https://developer.apple.com/documentation/passkit/pkpaymentrequest/shippingmethods) | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The shipping methods that you created in step 1. | | [`requiredShippingContactFields`](https://developer.apple.com/documentation/passkit/pkpaymentrequest/requiredshippingcontactfields) | | The shipping fields that you need from the shopper to fulfill the order. | | [`allowShippingContactEditing`](https://developer.apple.com/documentation/passkit/pkpaymentrequest/shippingcontacteditingmode) | | Set to **true** to let the shopper change the shipping address in the Apple Pay sheet. | | `supportsCouponCode` | | Set to **true** to show the coupon code field in the Apple Pay sheet. Requires iOS 15 or later. | | `couponCode` | | A coupon code to prefill in the coupon code field. | 3. Add the callbacks that you want to handle, and pass the `ApplePayConfiguration` to your `ApplePayComponentConfiguration`. **Configure the Apple Pay sheet** ```dart final applePayConfiguration = ApplePayConfiguration( merchantId: 'merchant.com.example', merchantName: 'Example Store', applePaySummaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Shipping', amount: Amount(value: 200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], shippingMethods: [ ApplePayShippingMethod( label: 'Standard Shipping', detail: 'Delivery in 3-5 business days', amount: Amount(value: 200, currency: 'EUR'), identifier: 'standard', ), ], requiredShippingContactFields: [ApplePayContactField.postalAddress], supportsCouponCode: true, // Add the callbacks from the following sections. ); ``` ## Configure the callback to handle shipping contact changes If the shopper selects or changes their shipping address, offer the shipping methods that you support for that address and recalculate the total: 1. Implement the `onSelectShippingContact` callback. It receives the shopper's `ApplePayContact` and the current summary items. 2. Return an `ApplePayShippingContactUpdate` with the following: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `summaryItems` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The updated summary items. To leave the payment unchanged, return the `currentSummaryItems` that the Component passes to the callback. | | `shippingMethods` | | The shipping methods that you offer for this address. | | `errors` | | The [errors](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#sheet-errors) to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the address. | To reject an address that you cannot ship to, return an error instead of new shipping methods. **Handle shipping contact changes** ```dart final applePayConfiguration = ApplePayConfiguration( // ...Other parameters. onSelectShippingContact: (contact, currentSummaryItems) async { if (contact.countryCode != 'NL') { return ApplePayShippingContactUpdate( summaryItems: currentSummaryItems, errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.shippingAddress, field: ApplePayErrorField.countryCode, localizedDescription: 'Shipping is only available in the Netherlands.', ), ], ); } return ApplePayShippingContactUpdate( summaryItems: currentSummaryItems, shippingMethods: [ ApplePayShippingMethod( label: 'Standard Shipping', detail: 'Delivery in 3-5 business days', amount: Amount(value: 200, currency: 'EUR'), identifier: 'standard', ), ], ); }, ); ``` ## Configure the callback to handle shipping method changes If the shopper selects a different shipping method, add the cost of that method to the total: 1. Implement the `onSelectShippingMethod` callback. It receives the selected `ApplePayShippingMethod` and the current summary items. 2. Return an `ApplePayShippingMethodUpdate` with the following: | Parameter | Required | Description | | -------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | | `summaryItems` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The updated summary items, including the cost of the selected shipping method. | You cannot return errors from this callback. Validate the shipping address in [`onSelectShippingContact` ](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#shipping-contact-changes)instead. **Handle shipping method changes** ```dart final applePayConfiguration = ApplePayConfiguration( // ...Other parameters. onSelectShippingMethod: (method, currentSummaryItems) async { return ApplePayShippingMethodUpdate( summaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: method.label, amount: method.amount, type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1000 + method.amount.value, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], ); }, ); ``` ## Configure the callback to handle coupon code changes If the shopper enters or changes a coupon code, apply a discount or tell the shopper that the code is not valid: 1. Set `supportsCouponCode` to **true** to show the coupon code field. 2. Implement the `onChangeCouponCode` callback. It receives the coupon code and the current summary items. 3. Return an `ApplePayCouponCodeUpdate` with the following: | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `summaryItems` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The updated summary items, including the discount. To leave the payment unchanged, return the `currentSummaryItems` that the Component passes to the callback. | | `shippingMethods` | | The shipping methods that you offer with this coupon code applied. | | `errors` | | The [errors](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#sheet-errors) to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the code. | To reject a code that is not valid, return an error instead of a discount. **Handle coupon code changes** ```dart final applePayConfiguration = ApplePayConfiguration( // ...Other parameters. onChangeCouponCode: (couponCode, currentSummaryItems) async { if (couponCode != 'DISCOUNT10') { return ApplePayCouponCodeUpdate( summaryItems: currentSummaryItems, errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.couponCode, localizedDescription: 'Enter a valid coupon code.', ), ], ); } return ApplePayCouponCodeUpdate( summaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Shipping', amount: Amount(value: 200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Discount', amount: Amount(value: -100, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1100, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], ); }, ); ``` ## Configure the callback to validate the payment Before the payment is submitted, run your own checks on the shopper details that you collected in the Apple Pay sheet: 1. Implement the `onAuthorize` callback. It receives an `ApplePayAuthorizedPayment`, which contains the payment token, the card network, and the contact details and shipping method that the shopper selected. 2. Return one of the following: | Result | Description | | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ApplePayAuthorizationResult.success()` | Continue with the payment. | | `ApplePayAuthorizationResult.failure(errors: [...])` | Stop the payment and show the [errors](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#sheet-errors) in the Apple Pay sheet. The sheet stays open so that the shopper can correct the problem. | **Validate the payment before submission** ```dart final applePayConfiguration = ApplePayConfiguration( // ...Other parameters. onAuthorize: (payment) async { final ApplePayAuthorizationResult authorizationResult; if (payment.shippingContact?.postalCode?.isEmpty ?? true) { authorizationResult = ApplePayAuthorizationResult.failure( errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.shippingAddress, field: ApplePayErrorField.postalCode, localizedDescription: 'Postal code is required.', ), ], ); } else { authorizationResult = const ApplePayAuthorizationResult.success(); } return authorizationResult; }, ); ``` ## Show the Apple Pay button Place the Apple Pay button where you want to offer express checkout, for example on your product or cart screen. The shopper selects Apple Pay there instead of going to your checkout, so Apple Pay is already the chosen payment method when the sheet opens. To show the button: 1. Get the Apple Pay payment method from your [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response. 2. Add an `AdyenApplePayComponent` to your screen: | Parameter | Required | Description | | -------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `configuration` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | Your `ApplePayComponentConfiguration`, which carries the `ApplePayConfiguration` that you built in the previous steps. Set `amount` on it, because the Advanced flow requires an amount. | | `paymentMethod` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The Apple Pay payment method from step 1. | | `checkout` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | Your `AdvancedCheckout`, with the `onSubmit` handler that submits the payment. | | `onPaymentResult` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | Called with the `PaymentResult` when the payment finishes. Show the outcome to the shopper. | | `style` | | An `ApplePayButtonStyle` that sets the button `theme`, `type`, and `cornerRadius`. | | `onUnavailable` | | Called when Apple Pay is not available on the device. | | `unavailableWidget` | | The widget to show instead of the button when Apple Pay is not available. | | `loadingIndicator` | | The widget to show while the Component loads. | | `width` and `height` | | The button size. Values below Apple's minimum button size are raised to the minimum. | The Component checks whether Apple Pay is available. Use `onUnavailable` and `unavailableWidget` to control what the screen shows when it is not. **Show the Apple Pay button** ```dart AdyenApplePayComponent( configuration: applePayComponentConfiguration, paymentMethod: applePayPaymentMethod, checkout: AdvancedCheckout(onSubmit: handleSubmit), onPaymentResult: (paymentResult) => showPaymentResult(paymentResult), style: const ApplePayButtonStyle( theme: ApplePayButtonTheme.black, type: ApplePayButtonType.buy, ), loadingIndicator: const CircularProgressIndicator(), ) ``` ## Test and go live Use Apple's test card numbers to test your integration. For a full list of test cards and instructions how to add these to your test device, see [Sandbox testing](https://developer.apple.com/apple-pay/sandbox-testing/) on Apple's Developer website. Check the status of an Apple Pay test payment in your [Customer Area](https://ca-test.adyen.com/) > **Payments** > **Payment list**. ### Going live To process live Apple Pay payments, your API credential needs to have the **API Clientside Encryption Payments role**. You can check this in your [live Customer Area](https://ca-live.adyen.com/) or ask your Admin user to verify. [Set up Apple Pay](https://docs.adyen.com/payment-methods/apple-pay/apple-pay-certificate/ios) on your Apple Pay Developer account for your live merchant identifier. ## Apple Pay sheet errors Use `ApplePayPaymentError` to tell the shopper what to correct. The Apple Pay sheet stays open and highlights the field that you specify. | Parameter | Required | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The [kind of error](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#error-types). | | `localizedDescription` | ![Required](https://docs.adyen.com/media/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto\&fetchpriority=auto) | The message that the Apple Pay sheet shows to the shopper. Translate this into the shopper's language. | | `field` | | The [field that is not valid](https://docs.adyen.com/payment-methods/apple-pay/flutter-component/express-checkout#error-fields). The Apple Pay sheet highlights this field. | ### Error types | Value | Use when | | ------------------- | ----------------------------------------------------------------------------- | | **shippingAddress** | A field in the shipping address is not valid. | | **billingAddress** | A field in the billing address is not valid. | | **contact** | A contact field, such as the email address or the phone number, is not valid. | | **couponCode** | The coupon code is not valid. | ### Error fields Set `field` to the part of the address or the contact that the shopper must correct. | Context | Values | | ------- | -------------------------------------------------------------------------------------------------------------------------------------- | | Address | **street**, **city**, **postalCode**, **administrativeArea**, **subAdministrativeArea**, **subLocality**, **country**, **countryCode** | | Contact | **name**, **phoneticName**, **emailAddress**, **phoneNumber**, **postalAddress** | ## Code samples The following code samples show the steps on this page in full. ** ### Dart **Component implementation example** ```dart // Step 1: Configure the Apple Pay sheet. final applePayConfiguration = ApplePayConfiguration( merchantId: 'merchant.com.example', merchantName: 'Example Store', applePaySummaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Shipping', amount: Amount(value: 200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], shippingMethods: [ ApplePayShippingMethod( label: 'Standard Shipping', detail: 'Delivery in 3-5 business days', amount: Amount(value: 200, currency: 'EUR'), identifier: 'standard', ), ], requiredShippingContactFields: [ApplePayContactField.postalAddress], supportsCouponCode: true, // Step 2: Configure the callback to handle shipping contact changes. onSelectShippingContact: (contact, currentSummaryItems) async { if (contact.countryCode != 'NL') { return ApplePayShippingContactUpdate( summaryItems: currentSummaryItems, errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.shippingAddress, field: ApplePayErrorField.countryCode, localizedDescription: 'Shipping is only available in the Netherlands.', ), ], ); } return ApplePayShippingContactUpdate( summaryItems: currentSummaryItems, shippingMethods: [ ApplePayShippingMethod( label: 'Standard Shipping', detail: 'Delivery in 3-5 business days', amount: Amount(value: 200, currency: 'EUR'), identifier: 'standard', ), ], ); }, // Step 3: Configure the callback to handle shipping method changes. onSelectShippingMethod: (method, currentSummaryItems) async { return ApplePayShippingMethodUpdate( summaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: method.label, amount: method.amount, type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1000 + method.amount.value, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], ); }, // Step 4: Configure the callback to handle coupon code changes. onChangeCouponCode: (couponCode, currentSummaryItems) async { if (couponCode != 'DISCOUNT10') { return ApplePayCouponCodeUpdate( summaryItems: currentSummaryItems, errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.couponCode, localizedDescription: 'Enter a valid coupon code.', ), ], ); } return ApplePayCouponCodeUpdate( summaryItems: [ ApplePaySummaryItem( label: 'Subtotal', amount: Amount(value: 1000, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Shipping', amount: Amount(value: 200, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Discount', amount: Amount(value: -100, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ApplePaySummaryItem( label: 'Example Store', amount: Amount(value: 1100, currency: 'EUR'), type: ApplePaySummaryItemType.definite, ), ], ); }, // Step 5: Configure the callback to validate the payment. onAuthorize: (payment) async { final ApplePayAuthorizationResult authorizationResult; if (payment.shippingContact?.postalCode?.isEmpty ?? true) { authorizationResult = ApplePayAuthorizationResult.failure( errors: [ ApplePayPaymentError( type: ApplePayPaymentErrorType.shippingAddress, field: ApplePayErrorField.postalCode, localizedDescription: 'Postal code is required.', ), ], ); } else { authorizationResult = const ApplePayAuthorizationResult.success(); } return authorizationResult; }, ); ``` **Show the Apple Pay button** ```dart // Step 6: Show the Apple Pay button on your product or cart screen. AdyenApplePayComponent( configuration: ApplePayComponentConfiguration( environment: Environment.test, clientKey: CLIENT_KEY, countryCode: COUNTRY_CODE, amount: Amount(value: 1200, currency: 'EUR'), applePayConfiguration: applePayConfiguration, ), paymentMethod: applePayPaymentMethod, checkout: AdvancedCheckout(onSubmit: handleSubmit), onPaymentResult: (paymentResult) => showPaymentResult(paymentResult), style: const ApplePayButtonStyle( theme: ApplePayButtonTheme.black, type: ApplePayButtonType.buy, ), loadingIndicator: const CircularProgressIndicator(), ) ``` ## See also * [Apple Pay Component integration](https://docs.adyen.com/payment-methods/apple-pay/flutter-component) * [Express checkout](https://docs.adyen.com/payment-methods/express-checkout) * [Handle Apple Pay errors](https://docs.adyen.com/payment-methods/apple-pay/handle-apple-pay-errors) * [API Explorer](https://docs.adyen.com/api-explorer/Checkout/latest/overview)