{"title":"Apple Pay express checkout","category":"default","creationDate":1796385374,"content":"<p>You can configure the Apple Pay Component for <a href=\"\/payment-methods\/express-checkout\">express checkout<\/a> 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.<\/p>\n<h2>Requirements<\/h2>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">An Advanced flow <a href=\"\/online-payments\/build-your-integration\/advanced-flow?platform=Flutter&amp;integration=Components\">Flutter Components integration<\/a>, v1.11.0 or later.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\"><ul><li markdown=\"1\">Apple Pay express checkout is available on iOS only.<\/li><li markdown=\"1\">Coupon codes require iOS 15 or later.<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin, make sure that you have: <ul><li markdown=\"1\">Set up your <a href=\"\/payment-methods\/apple-pay\/flutter-component\">Apple Pay Component integration<\/a>.<\/li><li markdown=\"1\"><a href=\"\/payment-methods\/apple-pay\/apple-pay-certificate\/ios\">Set up Apple Pay with your own certificate<\/a>.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How it works<\/h2>\n<p>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.<\/p>\n<h3>Integration steps<\/h3>\n<p>To offer express checkout with Apple Pay:<\/p>\n<ol>\n<li><a href=\"#configure-apple-pay\">Configure the Apple Pay sheet<\/a>.<\/li>\n<li><a href=\"#shipping-contact-changes\">Configure the callback to handle shipping contact changes<\/a>.<\/li>\n<li><a href=\"#shipping-method-changes\">Configure the callback to handle shipping method changes<\/a>.<\/li>\n<li><a href=\"#coupon-code-changes\">Configure the callback to handle coupon code changes<\/a>.<\/li>\n<li><a href=\"#validate-payment\">Configure the callback to validate the payment<\/a>.<\/li>\n<li><a href=\"#show-button\">Show the Apple Pay button<\/a> on your product or cart screen.<\/li>\n<\/ol>\n<h3>Shopper checkout experience<\/h3>\n<p>When the shopper checks out with Apple Pay:<\/p>\n<ol>\n<li>The shopper selects the Apple Pay button, and the Apple Pay sheet opens.<\/li>\n<li>The shopper selects a shipping contact, selects a shipping method, or enters a coupon code. The Component calls the matching callback each time.<\/li>\n<li>In the callback, you return updated summary items, updated shipping methods, or errors. The Apple Pay sheet shows what you return.<\/li>\n<li>The shopper authorizes the payment with Face ID or Touch ID. The Component calls <code>onAuthorize<\/code> before the payment is submitted, so that you can run your own checks.<\/li>\n<li>You submit the payment from your server.<\/li>\n<\/ol>\n<div id=\"mermaid-6b12aefc32289-wrapper\"><div id=\"mermaid-6b12aefc32289\" class=\"mermaid-shortcode loading\">CnNlcXVlbmNlRGlhZ3JhbQogICAgcGFydGljaXBhbnQgU2hvcHBlcgogICAgcGFydGljaXBhbnQgU2hlZXQgYXMgQXBwbGUgUGF5IHNoZWV0CiAgICBwYXJ0aWNpcGFudCBDb21wb25lbnQgYXMgQXBwbGUgUGF5IENvbXBvbmVudAogICAgcGFydGljaXBhbnQgQXBwIGFzIFlvdXIgYXBwCiAgICBwYXJ0aWNpcGFudCBTZXJ2ZXIgYXMgWW91ciBzZXJ2ZXIKICAgIHBhcnRpY2lwYW50IEFkeWVuCgogICAgU2hvcHBlci0+PkNvbXBvbmVudDogMS4gU2VsZWN0IHRoZSBBcHBsZSBQYXkgYnV0dG9uCiAgICBDb21wb25lbnQtPj5TaGVldDogT3BlbiB0aGUgQXBwbGUgUGF5IHNoZWV0CiAgICBsb29wIEVhY2ggdGltZSB0aGUgc2hvcHBlciBjaGFuZ2VzIGEgc2VsZWN0aW9uCiAgICAgICAgU2hvcHBlci0+PlNoZWV0OiAyLiBTZWxlY3QgYSBzaGlwcGluZyBjb250YWN0IG9yIHNoaXBwaW5nIG1ldGhvZCwgb3IgZW50ZXIgYSBjb3Vwb24gY29kZQogICAgICAgIENvbXBvbmVudC0+PkFwcDogQ2FsbCB0aGUgbWF0Y2hpbmcgY2FsbGJhY2sKICAgICAgICBBcHAtLT4+Q29tcG9uZW50OiAzLiBSZXR1cm4gdXBkYXRlZCBzdW1tYXJ5IGl0ZW1zLCBzaGlwcGluZyBtZXRob2RzLCBvciBlcnJvcnMKICAgICAgICBDb21wb25lbnQtPj5TaGVldDogU2hvdyB0aGUgdXBkYXRlCiAgICBlbmQKICAgIFNob3BwZXItPj5TaGVldDogNC4gQXV0aG9yaXplIHRoZSBwYXltZW50IHdpdGggRmFjZSBJRCBvciBUb3VjaCBJRAogICAgQ29tcG9uZW50LT4+QXBwOiBDYWxsIG9uQXV0aG9yaXplCiAgICBBcHAtLT4+Q29tcG9uZW50OiBSZXR1cm4gdGhlIGF1dGhvcml6YXRpb24gcmVzdWx0CiAgICBDb21wb25lbnQtPj5BcHA6IFBheW1lbnQgZGF0YQogICAgQXBwLT4+U2VydmVyOiBQYXltZW50IGRhdGEKICAgIFNlcnZlci0+PkFkeWVuOiA1LiBTdWJtaXQgdGhlIHBheW1lbnQK<\/div><\/div>\n<h2 id=\"configure-apple-pay\">Configure the Apple Pay sheet<\/h2>\n<p>Configure the line items, the shipping methods that you offer, and the shopper details that you require:<\/p>\n<ol>\n<li>\n<p>Create the shipping methods that you offer. Each shipping method is an <code>ApplePayShippingMethod<\/code>:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>label<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The name of the shipping method that the Apple Pay sheet shows, for example <span translate=\"no\"><strong>Standard shipping<\/strong><\/span>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>detail<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">A description that the Apple Pay sheet shows under the label, for example the carrier or the delivery time.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>amount<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The cost of this shipping method.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>identifier<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">Your own identifier for this shipping method. The Component returns this value to you in <code>onSelectShippingMethod<\/code>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>startDate<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The earliest delivery date.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>endDate<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The latest delivery date.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>Add the following to your <code>ApplePayConfiguration<\/code>, in addition to the <a href=\"\/payment-methods\/apple-pay\/flutter-component\">parameters that every Apple Pay integration needs<\/a>:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.apple.com\/documentation\/passkit\/pkpaymentrequest\/paymentsummaryitems\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>applePaySummaryItems<\/code>\n<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">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.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.apple.com\/documentation\/passkit\/pkpaymentrequest\/shippingmethods\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>shippingMethods<\/code>\n<\/a><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The shipping methods that you created in step 1.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.apple.com\/documentation\/passkit\/pkpaymentrequest\/requiredshippingcontactfields\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>requiredShippingContactFields<\/code>\n<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The shipping fields that you need from the shopper to fulfill the order.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><a href=\"https:\/\/developer.apple.com\/documentation\/passkit\/pkpaymentrequest\/shippingcontacteditingmode\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">\n  <code>allowShippingContactEditing<\/code>\n<\/a><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">Set to <span translate=\"no\"><strong>true<\/strong><\/span> to let the shopper change the shipping address in the Apple Pay sheet.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>supportsCouponCode<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">Set to <span translate=\"no\"><strong>true<\/strong><\/span> to show the coupon code field in the Apple Pay sheet. Requires iOS 15 or later.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>couponCode<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">A coupon code to prefill in the coupon code field.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>Add the callbacks that you want to handle, and pass the <code>ApplePayConfiguration<\/code> to your <code>ApplePayComponentConfiguration<\/code>.<\/p>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Configure the Apple Pay sheet'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;final applePayConfiguration = ApplePayConfiguration(\\n  merchantId: 'merchant.com.example',\\n  merchantName: 'Example Store',\\n  applePaySummaryItems: [\\n    ApplePaySummaryItem(\\n      label: 'Subtotal',\\n      amount: Amount(value: 1000, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n    ApplePaySummaryItem(\\n      label: 'Shipping',\\n      amount: Amount(value: 200, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n    ApplePaySummaryItem(\\n      label: 'Example Store',\\n      amount: Amount(value: 1200, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n  ],\\n  shippingMethods: [\\n    ApplePayShippingMethod(\\n      label: 'Standard Shipping',\\n      detail: 'Delivery in 3-5 business days',\\n      amount: Amount(value: 200, currency: 'EUR'),\\n      identifier: 'standard',\\n    ),\\n  ],\\n  requiredShippingContactFields: [ApplePayContactField.postalAddress],\\n  supportsCouponCode: true,\\n  \\\/\\\/ Add the callbacks from the following sections.\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"shipping-contact-changes\">Configure the callback to handle shipping contact changes<\/h2>\n<p>If the shopper selects or changes their shipping address, offer the shipping methods that you support for that address and recalculate the total:<\/p>\n<ol>\n<li>\n<p>Implement the <code>onSelectShippingContact<\/code> callback. It receives the shopper's <code>ApplePayContact<\/code> and the current summary items.<\/p>\n<\/li>\n<li>\n<p>Return an <code>ApplePayShippingContactUpdate<\/code> with the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>summaryItems<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The updated summary items. To leave the payment unchanged, return the <code>currentSummaryItems<\/code> that the Component passes to the callback.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>shippingMethods<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The shipping methods that you offer for this address.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>errors<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The <a href=\"#sheet-errors\">errors<\/a> to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the address.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To reject an address that you cannot ship to, return an error instead of new shipping methods.<\/p>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Handle shipping contact changes'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;final applePayConfiguration = ApplePayConfiguration(\\n  \\\/\\\/ ...Other parameters.\\n  onSelectShippingContact: (contact, currentSummaryItems) async {\\n    if (contact.countryCode != 'NL') {\\n      return ApplePayShippingContactUpdate(\\n        summaryItems: currentSummaryItems,\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.shippingAddress,\\n            field: ApplePayErrorField.countryCode,\\n            localizedDescription: 'Shipping is only available in the Netherlands.',\\n          ),\\n        ],\\n      );\\n    }\\n\\n    return ApplePayShippingContactUpdate(\\n      summaryItems: currentSummaryItems,\\n      shippingMethods: [\\n        ApplePayShippingMethod(\\n          label: 'Standard Shipping',\\n          detail: 'Delivery in 3-5 business days',\\n          amount: Amount(value: 200, currency: 'EUR'),\\n          identifier: 'standard',\\n        ),\\n      ],\\n    );\\n  },\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"shipping-method-changes\">Configure the callback to handle shipping method changes<\/h2>\n<p>If the shopper selects a different shipping method, add the cost of that method to the total:<\/p>\n<ol>\n<li>\n<p>Implement the <code>onSelectShippingMethod<\/code> callback. It receives the selected <code>ApplePayShippingMethod<\/code> and the current summary items.<\/p>\n<\/li>\n<li>\n<p>Return an <code>ApplePayShippingMethodUpdate<\/code> with the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>summaryItems<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The updated summary items, including the cost of the selected shipping method.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>You cannot return errors from this callback. Validate the shipping address in <a href=\"#shipping-contact-changes\">\n  <code>onSelectShippingContact<\/code>\n<\/a> instead.<\/p>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Handle shipping method changes'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;final applePayConfiguration = ApplePayConfiguration(\\n  \\\/\\\/ ...Other parameters.\\n  onSelectShippingMethod: (method, currentSummaryItems) async {\\n    return ApplePayShippingMethodUpdate(\\n      summaryItems: [\\n        ApplePaySummaryItem(\\n          label: 'Subtotal',\\n          amount: Amount(value: 1000, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: method.label,\\n          amount: method.amount,\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Example Store',\\n          amount: Amount(value: 1000 + method.amount.value, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n      ],\\n    );\\n  },\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"coupon-code-changes\">Configure the callback to handle coupon code changes<\/h2>\n<p>If the shopper enters or changes a coupon code, apply a discount or tell the shopper that the code is not valid:<\/p>\n<ol>\n<li>\n<p>Set <code>supportsCouponCode<\/code> to <span translate=\"no\"><strong>true<\/strong><\/span> to show the coupon code field.<\/p>\n<\/li>\n<li>\n<p>Implement the <code>onChangeCouponCode<\/code> callback. It receives the coupon code and the current summary items.<\/p>\n<\/li>\n<li>\n<p>Return an <code>ApplePayCouponCodeUpdate<\/code> with the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>summaryItems<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The updated summary items, including the discount. To leave the payment unchanged, return the <code>currentSummaryItems<\/code> that the Component passes to the callback.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>shippingMethods<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The shipping methods that you offer with this coupon code applied.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>errors<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The <a href=\"#sheet-errors\">errors<\/a> to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the code.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To reject a code that is not valid, return an error instead of a discount.<\/p>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Handle coupon code changes'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;final applePayConfiguration = ApplePayConfiguration(\\n  \\\/\\\/ ...Other parameters.\\n  onChangeCouponCode: (couponCode, currentSummaryItems) async {\\n    if (couponCode != 'DISCOUNT10') {\\n      return ApplePayCouponCodeUpdate(\\n        summaryItems: currentSummaryItems,\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.couponCode,\\n            localizedDescription: 'Enter a valid coupon code.',\\n          ),\\n        ],\\n      );\\n    }\\n\\n    return ApplePayCouponCodeUpdate(\\n      summaryItems: [\\n        ApplePaySummaryItem(\\n          label: 'Subtotal',\\n          amount: Amount(value: 1000, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Shipping',\\n          amount: Amount(value: 200, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Discount',\\n          amount: Amount(value: -100, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Example Store',\\n          amount: Amount(value: 1100, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n      ],\\n    );\\n  },\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"validate-payment\">Configure the callback to validate the payment<\/h2>\n<p>Before the payment is submitted, run your own checks on the shopper details that you collected in the Apple Pay sheet:<\/p>\n<ol>\n<li>\n<p>Implement the <code>onAuthorize<\/code> callback. It receives an <code>ApplePayAuthorizedPayment<\/code>, which contains the payment token, the card network, and the contact details and shipping method that the shopper selected.<\/p>\n<\/li>\n<li>\n<p>Return one of the following:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Result<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>ApplePayAuthorizationResult.success()<\/code><\/td>\n<td style=\"text-align: left;\">Continue with the payment.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>ApplePayAuthorizationResult.failure(errors: [...])<\/code><\/td>\n<td style=\"text-align: left;\">Stop the payment and show the <a href=\"#sheet-errors\">errors<\/a> in the Apple Pay sheet. The sheet stays open so that the shopper can correct the problem.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Validate the payment before submission'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;final applePayConfiguration = ApplePayConfiguration(\\n  \\\/\\\/ ...Other parameters.\\n  onAuthorize: (payment) async {\\n    final ApplePayAuthorizationResult authorizationResult;\\n    if (payment.shippingContact?.postalCode?.isEmpty ?? true) {\\n      authorizationResult = ApplePayAuthorizationResult.failure(\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.shippingAddress,\\n            field: ApplePayErrorField.postalCode,\\n            localizedDescription: 'Postal code is required.',\\n          ),\\n        ],\\n      );\\n    } else {\\n      authorizationResult = const ApplePayAuthorizationResult.success();\\n    }\\n    return authorizationResult;\\n  },\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"show-button\">Show the Apple Pay button<\/h2>\n<p>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.<\/p>\n<p>To show the button:<\/p>\n<ol>\n<li>\n<p>Get the Apple Pay payment method from your  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/post\/paymentMethods\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">\/paymentMethods<\/a> response.<\/p>\n<\/li>\n<li>\n<p>Add an <code>AdyenApplePayComponent<\/code> to your screen:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>configuration<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">Your <code>ApplePayComponentConfiguration<\/code>, which carries the <code>ApplePayConfiguration<\/code> that you built in the previous steps. Set <code>amount<\/code> on it, because the Advanced flow requires an amount.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>paymentMethod<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The Apple Pay payment method from step 1.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>checkout<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">Your <code>AdvancedCheckout<\/code>, with the <code>onSubmit<\/code> handler that submits the payment.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>onPaymentResult<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">Called with the <code>PaymentResult<\/code> when the payment finishes. Show the outcome to the shopper.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>style<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">An <code>ApplePayButtonStyle<\/code> that sets the button <code>theme<\/code>, <code>type<\/code>, and <code>cornerRadius<\/code>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>onUnavailable<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">Called when Apple Pay is not available on the device.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>unavailableWidget<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The widget to show instead of the button when Apple Pay is not available.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>loadingIndicator<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The widget to show while the Component loads.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>width<\/code> and <code>height<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The button size. Values below Apple's minimum button size are raised to the minimum.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The Component checks whether Apple Pay is available. Use <code>onUnavailable<\/code> and <code>unavailableWidget<\/code> to control what the screen shows when it is not.<\/p>\n<\/li>\n<\/ol>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Show the Apple Pay button'\" :id=\"''\" :code-data='[{\"language\":\"dart\",\"tabTitle\":\"\",\"content\":\"AdyenApplePayComponent(\\n  configuration: applePayComponentConfiguration,\\n  paymentMethod: applePayPaymentMethod,\\n  checkout: AdvancedCheckout(onSubmit: handleSubmit),\\n  onPaymentResult: (paymentResult) =&gt; showPaymentResult(paymentResult),\\n  style: const ApplePayButtonStyle(\\n    theme: ApplePayButtonTheme.black,\\n    type: ApplePayButtonType.buy,\\n  ),\\n  loadingIndicator: const CircularProgressIndicator(),\\n)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<h2 id=\"test-and-go-live\">Test and go live<\/h2>\n<p>Use Apple's test\u00a0card numbers\u00a0to\u00a0test your integration.<\/p>\n<p>For a full list of test cards and instructions how to add these to your test device, see <a href=\"https:\/\/developer.apple.com\/apple-pay\/sandbox-testing\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Sandbox testing<\/a>\u00a0on\u00a0Apple's Developer website.<\/p>\n<p> <\/p>\n<p>Check the status of an Apple Pay test payment in your\u00a0<a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>\u00a0&gt;\u00a0<strong>Payments<\/strong>\u00a0&gt; <strong>Payment list<\/strong>.<\/p>\n<h3>Going live<\/h3>\n<p>To process live Apple Pay payments, your API credential needs to have the <strong>API Clientside Encryption Payments role<\/strong>. You can check this in your <a href=\"https:\/\/ca-live.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">live Customer Area<\/a> or ask your Admin user to verify.<\/p>\n<p> <\/p>\n<p><a href=\"\/payment-methods\/apple-pay\/apple-pay-certificate\/ios\">Set up Apple Pay<\/a> on your Apple Pay Developer account for your live merchant identifier.<\/p>\n<h2 id=\"sheet-errors\">Apple Pay sheet errors<\/h2>\n<p>Use <code>ApplePayPaymentError<\/code> to tell the shopper what to correct. The Apple Pay sheet stays open and highlights the field that you specify.<\/p>\n<div class=\"sticky-table-container\">\n    \n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>type<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The <a href=\"#error-types\">kind of error<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>localizedDescription<\/code><\/td>\n<td style=\"text-align: center;\"><span class=\"hint--bottom\" data-hint=\"Required\" markdown=\"1\"><img style=\"width: 25px;\" alt=\"Required\" src=\"\/media\/732127089c689593ccb0331d565e5773bed94e60145cae96672212374facb8c6.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/span><\/td>\n<td style=\"text-align: left;\">The message that the Apple Pay sheet shows to the shopper. Translate this into the shopper's language.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>field<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\">The <a href=\"#error-fields\">field that is not valid<\/a>. The Apple Pay sheet highlights this field.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n<\/div>\n\n<h3 id=\"error-types\">Error types<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Value<\/th>\n<th style=\"text-align: left;\">Use when<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>shippingAddress<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">A field in the shipping address is not valid.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>billingAddress<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">A field in the billing address is not valid.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>contact<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">A contact field, such as the email address or the phone number, is not valid.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>couponCode<\/strong><\/span><\/td>\n<td style=\"text-align: left;\">The coupon code is not valid.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3 id=\"error-fields\">Error fields<\/h3>\n<p>Set <code>field<\/code> to the part of the address or the contact that the shopper must correct.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Context<\/th>\n<th style=\"text-align: left;\">Values<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Address<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>street<\/strong><\/span>, <span translate=\"no\"><strong>city<\/strong><\/span>, <span translate=\"no\"><strong>postalCode<\/strong><\/span>, <span translate=\"no\"><strong>administrativeArea<\/strong><\/span>, <span translate=\"no\"><strong>subAdministrativeArea<\/strong><\/span>, <span translate=\"no\"><strong>subLocality<\/strong><\/span>, <span translate=\"no\"><strong>country<\/strong><\/span>, <span translate=\"no\"><strong>countryCode<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Contact<\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>name<\/strong><\/span>, <span translate=\"no\"><strong>phoneticName<\/strong><\/span>, <span translate=\"no\"><strong>emailAddress<\/strong><\/span>, <span translate=\"no\"><strong>phoneNumber<\/strong><\/span>, <span translate=\"no\"><strong>postalAddress<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Code samples<\/h2>\n<p>The following code samples show the steps on this page in full.<\/p>\n<div class=\"accordion-shortcode adl-accordion adl-accordion--max-height-transition\" data-expand=\"true\" data-ignore=\"anchorjs-link\">\n    \n    <div class=\"adl-accordion__item\" style=\"\">\n        <div tabindex=\"0\" role=\"item\" aria-expanded=\"false\" class=\"adl-accordion__header\">\n            <i class=\"adl-accordion__toggle adl-icon-chevron-down\"><\/i>\n            <div class=\"adl-accordion__title-wrapper\" data-accordion=\"#dart\">\n                                    <h3 class=\"adl-accordion__title\">Dart<\/h3>\n                            <\/div>\n        <\/div>\n        <div role=\"region\" class=\"adl-accordion__content\">\n            \n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Component implementation example'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;\\\/\\\/ Step 1: Configure the Apple Pay sheet.\\n\\nfinal applePayConfiguration = ApplePayConfiguration(\\n  merchantId: 'merchant.com.example',\\n  merchantName: 'Example Store',\\n  applePaySummaryItems: [\\n    ApplePaySummaryItem(\\n      label: 'Subtotal',\\n      amount: Amount(value: 1000, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n    ApplePaySummaryItem(\\n      label: 'Shipping',\\n      amount: Amount(value: 200, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n    ApplePaySummaryItem(\\n      label: 'Example Store',\\n      amount: Amount(value: 1200, currency: 'EUR'),\\n      type: ApplePaySummaryItemType.definite,\\n    ),\\n  ],\\n  shippingMethods: [\\n    ApplePayShippingMethod(\\n      label: 'Standard Shipping',\\n      detail: 'Delivery in 3-5 business days',\\n      amount: Amount(value: 200, currency: 'EUR'),\\n      identifier: 'standard',\\n    ),\\n  ],\\n  requiredShippingContactFields: [ApplePayContactField.postalAddress],\\n  supportsCouponCode: true,\\n\\n\\\/\\\/ Step 2: Configure the callback to handle shipping contact changes.\\n\\n  onSelectShippingContact: (contact, currentSummaryItems) async {\\n    if (contact.countryCode != 'NL') {\\n      return ApplePayShippingContactUpdate(\\n        summaryItems: currentSummaryItems,\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.shippingAddress,\\n            field: ApplePayErrorField.countryCode,\\n            localizedDescription: 'Shipping is only available in the Netherlands.',\\n          ),\\n        ],\\n      );\\n    }\\n\\n    return ApplePayShippingContactUpdate(\\n      summaryItems: currentSummaryItems,\\n      shippingMethods: [\\n        ApplePayShippingMethod(\\n          label: 'Standard Shipping',\\n          detail: 'Delivery in 3-5 business days',\\n          amount: Amount(value: 200, currency: 'EUR'),\\n          identifier: 'standard',\\n        ),\\n      ],\\n    );\\n  },\\n\\n\\\/\\\/ Step 3: Configure the callback to handle shipping method changes.\\n\\n  onSelectShippingMethod: (method, currentSummaryItems) async {\\n    return ApplePayShippingMethodUpdate(\\n      summaryItems: [\\n        ApplePaySummaryItem(\\n          label: 'Subtotal',\\n          amount: Amount(value: 1000, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: method.label,\\n          amount: method.amount,\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Example Store',\\n          amount: Amount(value: 1000 + method.amount.value, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n      ],\\n    );\\n  },\\n\\n\\\/\\\/ Step 4: Configure the callback to handle coupon code changes.\\n\\n  onChangeCouponCode: (couponCode, currentSummaryItems) async {\\n    if (couponCode != 'DISCOUNT10') {\\n      return ApplePayCouponCodeUpdate(\\n        summaryItems: currentSummaryItems,\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.couponCode,\\n            localizedDescription: 'Enter a valid coupon code.',\\n          ),\\n        ],\\n      );\\n    }\\n\\n    return ApplePayCouponCodeUpdate(\\n      summaryItems: [\\n        ApplePaySummaryItem(\\n          label: 'Subtotal',\\n          amount: Amount(value: 1000, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Shipping',\\n          amount: Amount(value: 200, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Discount',\\n          amount: Amount(value: -100, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n        ApplePaySummaryItem(\\n          label: 'Example Store',\\n          amount: Amount(value: 1100, currency: 'EUR'),\\n          type: ApplePaySummaryItemType.definite,\\n        ),\\n      ],\\n    );\\n  },\\n\\n\\\/\\\/ Step 5: Configure the callback to validate the payment.\\n\\n  onAuthorize: (payment) async {\\n    final ApplePayAuthorizationResult authorizationResult;\\n    if (payment.shippingContact?.postalCode?.isEmpty ?? true) {\\n      authorizationResult = ApplePayAuthorizationResult.failure(\\n        errors: [\\n          ApplePayPaymentError(\\n            type: ApplePayPaymentErrorType.shippingAddress,\\n            field: ApplePayErrorField.postalCode,\\n            localizedDescription: 'Postal code is required.',\\n          ),\\n        ],\\n      );\\n    } else {\\n      authorizationResult = const ApplePayAuthorizationResult.success();\\n    }\\n    return authorizationResult;\\n  },\\n);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Show the Apple Pay button'\" :id=\"''\" :code-data=\"[{&quot;language&quot;:&quot;dart&quot;,&quot;tabTitle&quot;:&quot;&quot;,&quot;content&quot;:&quot;\\\/\\\/ Step 6: Show the Apple Pay button on your product or cart screen.\\n\\nAdyenApplePayComponent(\\n  configuration: ApplePayComponentConfiguration(\\n    environment: Environment.test,\\n    clientKey: CLIENT_KEY,\\n    countryCode: COUNTRY_CODE,\\n    amount: Amount(value: 1200, currency: 'EUR'),\\n    applePayConfiguration: applePayConfiguration,\\n  ),\\n  paymentMethod: applePayPaymentMethod,\\n  checkout: AdvancedCheckout(onSubmit: handleSubmit),\\n  onPaymentResult: (paymentResult) =&gt; showPaymentResult(paymentResult),\\n  style: const ApplePayButtonStyle(\\n    theme: ApplePayButtonTheme.black,\\n    type: ApplePayButtonType.buy,\\n  ),\\n  loadingIndicator: const CircularProgressIndicator(),\\n)&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n\n        <\/div>\n    <\/div>\n<\/div>\n\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/payment-methods\/apple-pay\/flutter-component\"\n                        target=\"_self\"\n                        >\n                    Apple Pay Component integration\n                <\/a><\/li><li><a href=\"\/payment-methods\/express-checkout\"\n                        target=\"_self\"\n                        >\n                    Express checkout\n                <\/a><\/li><li><a href=\"\/payment-methods\/apple-pay\/handle-apple-pay-errors\"\n                        target=\"_self\"\n                        >\n                    Handle Apple Pay errors\n                <\/a><\/li><li><a href=\"https:\/\/docs.adyen.com\/api-explorer\/Checkout\/latest\/overview\"\n                        target=\"_blank\"\n                         class=\"external\">\n                    API Explorer\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/payment-methods\/apple-pay\/flutter-component\/express-checkout","articleFields":{"description":"Configure the Apple Pay Component for express checkout in your Flutter app.","feedback_component":true,"filters_component":false,"parameters":{"integration_guide_url":"build-your-integration\/advanced-flow?platform=Flutter&integration=Components"}},"algolia":{"url":"https:\/\/docs.adyen.com\/payment-methods\/apple-pay\/flutter-component\/express-checkout","title":"Apple Pay express checkout","content":"You can configure the Apple Pay Component for 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.\nRequirements\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nAn Advanced flow Flutter Components integration, v1.11.0 or later.\n\n\nLimitations\nApple Pay express checkout is available on iOS only.Coupon codes require iOS 15 or later.\n\n\nSetup steps\nBefore you begin, make sure that you have: Set up your Apple Pay Component integration.Set up Apple Pay with your own certificate.\n\n\n\nHow it works\nFor 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.\nIntegration steps\nTo offer express checkout with Apple Pay:\n\nConfigure the Apple Pay sheet.\nConfigure the callback to handle shipping contact changes.\nConfigure the callback to handle shipping method changes.\nConfigure the callback to handle coupon code changes.\nConfigure the callback to validate the payment.\nShow the Apple Pay button on your product or cart screen.\n\nShopper checkout experience\nWhen the shopper checks out with Apple Pay:\n\nThe shopper selects the Apple Pay button, and the Apple Pay sheet opens.\nThe shopper selects a shipping contact, selects a shipping method, or enters a coupon code. The Component calls the matching callback each time.\nIn the callback, you return updated summary items, updated shipping methods, or errors. The Apple Pay sheet shows what you return.\nThe 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.\nYou submit the payment from your server.\n\nCnNlcXVlbmNlRGlhZ3JhbQogICAgcGFydGljaXBhbnQgU2hvcHBlcgogICAgcGFydGljaXBhbnQgU2hlZXQgYXMgQXBwbGUgUGF5IHNoZWV0CiAgICBwYXJ0aWNpcGFudCBDb21wb25lbnQgYXMgQXBwbGUgUGF5IENvbXBvbmVudAogICAgcGFydGljaXBhbnQgQXBwIGFzIFlvdXIgYXBwCiAgICBwYXJ0aWNpcGFudCBTZXJ2ZXIgYXMgWW91ciBzZXJ2ZXIKICAgIHBhcnRpY2lwYW50IEFkeWVuCgogICAgU2hvcHBlci0+PkNvbXBvbmVudDogMS4gU2VsZWN0IHRoZSBBcHBsZSBQYXkgYnV0dG9uCiAgICBDb21wb25lbnQtPj5TaGVldDogT3BlbiB0aGUgQXBwbGUgUGF5IHNoZWV0CiAgICBsb29wIEVhY2ggdGltZSB0aGUgc2hvcHBlciBjaGFuZ2VzIGEgc2VsZWN0aW9uCiAgICAgICAgU2hvcHBlci0+PlNoZWV0OiAyLiBTZWxlY3QgYSBzaGlwcGluZyBjb250YWN0IG9yIHNoaXBwaW5nIG1ldGhvZCwgb3IgZW50ZXIgYSBjb3Vwb24gY29kZQogICAgICAgIENvbXBvbmVudC0+PkFwcDogQ2FsbCB0aGUgbWF0Y2hpbmcgY2FsbGJhY2sKICAgICAgICBBcHAtLT4+Q29tcG9uZW50OiAzLiBSZXR1cm4gdXBkYXRlZCBzdW1tYXJ5IGl0ZW1zLCBzaGlwcGluZyBtZXRob2RzLCBvciBlcnJvcnMKICAgICAgICBDb21wb25lbnQtPj5TaGVldDogU2hvdyB0aGUgdXBkYXRlCiAgICBlbmQKICAgIFNob3BwZXItPj5TaGVldDogNC4gQXV0aG9yaXplIHRoZSBwYXltZW50IHdpdGggRmFjZSBJRCBvciBUb3VjaCBJRAogICAgQ29tcG9uZW50LT4+QXBwOiBDYWxsIG9uQXV0aG9yaXplCiAgICBBcHAtLT4+Q29tcG9uZW50OiBSZXR1cm4gdGhlIGF1dGhvcml6YXRpb24gcmVzdWx0CiAgICBDb21wb25lbnQtPj5BcHA6IFBheW1lbnQgZGF0YQogICAgQXBwLT4+U2VydmVyOiBQYXltZW50IGRhdGEKICAgIFNlcnZlci0+PkFkeWVuOiA1LiBTdWJtaXQgdGhlIHBheW1lbnQK\nConfigure the Apple Pay sheet\nConfigure the line items, the shipping methods that you offer, and the shopper details that you require:\n\n\nCreate the shipping methods that you offer. Each shipping method is an ApplePayShippingMethod:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nlabel\n\nThe name of the shipping method that the Apple Pay sheet shows, for example Standard shipping.\n\n\ndetail\n\nA description that the Apple Pay sheet shows under the label, for example the carrier or the delivery time.\n\n\namount\n\nThe cost of this shipping method.\n\n\nidentifier\n\nYour own identifier for this shipping method. The Component returns this value to you in onSelectShippingMethod.\n\n\nstartDate\n\nThe earliest delivery date.\n\n\nendDate\n\nThe latest delivery date.\n\n\n\n\n\nAdd the following to your ApplePayConfiguration, in addition to the parameters that every Apple Pay integration needs:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\n\n  applePaySummaryItems\n\n\nThe 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.\n\n\n\n  shippingMethods\n\n\nThe shipping methods that you created in step 1.\n\n\n\n  requiredShippingContactFields\n\n\nThe shipping fields that you need from the shopper to fulfill the order.\n\n\n\n  allowShippingContactEditing\n\n\nSet to true to let the shopper change the shipping address in the Apple Pay sheet.\n\n\nsupportsCouponCode\n\nSet to true to show the coupon code field in the Apple Pay sheet. Requires iOS 15 or later.\n\n\ncouponCode\n\nA coupon code to prefill in the coupon code field.\n\n\n\n\n\nAdd the callbacks that you want to handle, and pass the ApplePayConfiguration to your ApplePayComponentConfiguration.\n\n\n\n    \n\nConfigure the callback to handle shipping contact changes\nIf the shopper selects or changes their shipping address, offer the shipping methods that you support for that address and recalculate the total:\n\n\nImplement the onSelectShippingContact callback. It receives the shopper's ApplePayContact and the current summary items.\n\n\nReturn an ApplePayShippingContactUpdate with the following:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsummaryItems\n\nThe updated summary items. To leave the payment unchanged, return the currentSummaryItems that the Component passes to the callback.\n\n\nshippingMethods\n\nThe shipping methods that you offer for this address.\n\n\nerrors\n\nThe errors to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the address.\n\n\n\nTo reject an address that you cannot ship to, return an error instead of new shipping methods.\n\n\n\n    \n\nConfigure the callback to handle shipping method changes\nIf the shopper selects a different shipping method, add the cost of that method to the total:\n\n\nImplement the onSelectShippingMethod callback. It receives the selected ApplePayShippingMethod and the current summary items.\n\n\nReturn an ApplePayShippingMethodUpdate with the following:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsummaryItems\n\nThe updated summary items, including the cost of the selected shipping method.\n\n\n\nYou cannot return errors from this callback. Validate the shipping address in \n  onSelectShippingContact\n instead.\n\n\n\n    \n\nConfigure the callback to handle coupon code changes\nIf the shopper enters or changes a coupon code, apply a discount or tell the shopper that the code is not valid:\n\n\nSet supportsCouponCode to true to show the coupon code field.\n\n\nImplement the onChangeCouponCode callback. It receives the coupon code and the current summary items.\n\n\nReturn an ApplePayCouponCodeUpdate with the following:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nsummaryItems\n\nThe updated summary items, including the discount. To leave the payment unchanged, return the currentSummaryItems that the Component passes to the callback.\n\n\nshippingMethods\n\nThe shipping methods that you offer with this coupon code applied.\n\n\nerrors\n\nThe errors to show in the Apple Pay sheet. The sheet stays open so that the shopper can correct the code.\n\n\n\nTo reject a code that is not valid, return an error instead of a discount.\n\n\n\n    \n\nConfigure the callback to validate the payment\nBefore the payment is submitted, run your own checks on the shopper details that you collected in the Apple Pay sheet:\n\n\nImplement 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.\n\n\nReturn one of the following:\n\n\n\nResult\nDescription\n\n\n\n\nApplePayAuthorizationResult.success()\nContinue with the payment.\n\n\nApplePayAuthorizationResult.failure(errors: [...])\nStop the payment and show the errors in the Apple Pay sheet. The sheet stays open so that the shopper can correct the problem.\n\n\n\n\n\n\n    \n\nShow the Apple Pay button\nPlace 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.\nTo show the button:\n\n\nGet the Apple Pay payment method from your  \/paymentMethods response.\n\n\nAdd an AdyenApplePayComponent to your screen:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nconfiguration\n\nYour ApplePayComponentConfiguration, which carries the ApplePayConfiguration that you built in the previous steps. Set amount on it, because the Advanced flow requires an amount.\n\n\npaymentMethod\n\nThe Apple Pay payment method from step 1.\n\n\ncheckout\n\nYour AdvancedCheckout, with the onSubmit handler that submits the payment.\n\n\nonPaymentResult\n\nCalled with the PaymentResult when the payment finishes. Show the outcome to the shopper.\n\n\nstyle\n\nAn ApplePayButtonStyle that sets the button theme, type, and cornerRadius.\n\n\nonUnavailable\n\nCalled when Apple Pay is not available on the device.\n\n\nunavailableWidget\n\nThe widget to show instead of the button when Apple Pay is not available.\n\n\nloadingIndicator\n\nThe widget to show while the Component loads.\n\n\nwidth and height\n\nThe button size. Values below Apple's minimum button size are raised to the minimum.\n\n\n\nThe Component checks whether Apple Pay is available. Use onUnavailable and unavailableWidget to control what the screen shows when it is not.\n\n\n\n    \n\nTest and go live\nUse Apple's test\u00a0card numbers\u00a0to\u00a0test your integration.\nFor a full list of test cards and instructions how to add these to your test device, see Sandbox testing\u00a0on\u00a0Apple's Developer website.\n \nCheck the status of an Apple Pay test payment in your\u00a0Customer Area\u00a0&gt;\u00a0Payments\u00a0&gt; Payment list.\nGoing live\nTo 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 or ask your Admin user to verify.\n \nSet up Apple Pay on your Apple Pay Developer account for your live merchant identifier.\nApple Pay sheet errors\nUse ApplePayPaymentError to tell the shopper what to correct. The Apple Pay sheet stays open and highlights the field that you specify.\n\n    \n\n\n\nParameter\nRequired\nDescription\n\n\n\n\ntype\n\nThe kind of error.\n\n\nlocalizedDescription\n\nThe message that the Apple Pay sheet shows to the shopper. Translate this into the shopper's language.\n\n\nfield\n\nThe field that is not valid. The Apple Pay sheet highlights this field.\n\n\n\n\n\n\nError types\n\n\n\nValue\nUse when\n\n\n\n\nshippingAddress\nA field in the shipping address is not valid.\n\n\nbillingAddress\nA field in the billing address is not valid.\n\n\ncontact\nA contact field, such as the email address or the phone number, is not valid.\n\n\ncouponCode\nThe coupon code is not valid.\n\n\n\nError fields\nSet field to the part of the address or the contact that the shopper must correct.\n\n\n\nContext\nValues\n\n\n\n\nAddress\nstreet, city, postalCode, administrativeArea, subAdministrativeArea, subLocality, country, countryCode\n\n\nContact\nname, phoneticName, emailAddress, phoneNumber, postalAddress\n\n\n\nCode samples\nThe following code samples show the steps on this page in full.\n\n    \n    \n        \n            \n            \n                                    Dart\n                            \n        \n        \n            \n\n    \n\n\n    \n\n\n        \n    \n\n\nSee also\n\n\n                    Apple Pay Component integration\n                \n                    Express checkout\n                \n                    Handle Apple Pay errors\n                \n                    API Explorer\n                \n","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"Payment methods","lvl2":"Apple Pay","lvl3":"Apple Pay Component integration","lvl4":"Apple Pay express checkout"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/payment-methods","lvl2":"https:\/\/docs.adyen.com\/payment-methods\/apple-pay","lvl3":"https:\/\/docs.adyen.com\/payment-methods\/apple-pay\/flutter-component","lvl4":"\/payment-methods\/apple-pay\/flutter-component\/express-checkout"},"levels":5,"category":"Payment method","category_color":"green","tags":["Apple","express","checkout"]}}
