{"title":"Pull provisioning from Apple Wallet","category":"default","creationDate":1679910960,"content":"<p>In addition to <a href=\"\/issuing\/tokens-digital-wallet\/in-app-push-provisioning\">in-app push provisioning<\/a>, you must also support pull provisioning from Apple Wallet. After implementing the Apple Wallet extension, your app's name and icon appears in the <span translate=\"no\"><strong>From Apps on Your iPhone<\/strong><\/span> list of cards available to add to the Wallet.<\/p>\n<div class=\"notices yellow\">\n<p>If you are integrating pull provisioning from Apple Wallet, you must also integrate <a href=\"\/issuing\/tokens-digital-wallet\/in-app-push-provisioning\">in-app push provisioning for Apple Pay<\/a>.<\/p>\n<\/div>\n<h2>Requirements<\/h2>\n<p>Before you begin, take into account the following requirements, limitations, and preparations.<\/p>\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;\">You need an integration that supports <a href=\"\/issuing\">Adyen Issuing<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong><a href=\"\/issuing\/manage-access\/api-credentials-web-service\">API credentials<\/a><\/strong><\/td>\n<td style=\"text-align: left;\">Your API credential must have the following role:<br\/><ul><li><strong>Bank Issuing PaymentInstrument Network Token Activation Data role<\/strong><\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Limitations<\/strong><\/td>\n<td style=\"text-align: left;\">Your app must target iOS 13.4 or later. Your development environment must use Xcode 14 or later and Swift 5.7 or later.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Install the <a href=\"https:\/\/github.com\/Adyen\/adyen-apple-pay-provisioning-ios\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Adyen Apple Pay Provisioning SDK<\/a> following the instructions in the repository's README file.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Extension provisioning flow<\/h2>\n<p>The following sequence diagram shows the flow for pull provisioning from Apple Wallet.<\/p>\n<p><img alt=\"\" src=\"\/media\/d6f57ae0e388507882b3c96fb97c083ee6c7125ef4dc173b4e81b1d4a0bd25da.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/p>\n<p>As shown in the diagram, the provisioning flow is the following:<\/p>\n<ol>\n<li><a href=\"#show-your-app-on-wallet\">Show your app on Apple Wallet<\/a><\/li>\n<li><a href=\"#show-card-passes\">Show card passes<\/a><\/li>\n<li><a href=\"#start-provisioning-process\">Generate a request to add a card<\/a><\/li>\n<li><a href=\"#add-card\">Provision the card<\/a><\/li>\n<\/ol>\n<h2>Add Apple extensions<\/h2>\n<p>Before you implement pull provisioning from Apple Wallet:<\/p>\n<ol>\n<li><a href=\"#add-wallet-extension\">Add the Apple Wallet extension<\/a>.<\/li>\n<li><a href=\"#add-auth-extension\">Add Authentication UI extension<\/a>.<\/li>\n<\/ol>\n<h3 id=\"add-wallet-extension\">Add the Apple Wallet extension<\/h3>\n<p>To add the Apple Wallet extension:<\/p>\n<ol>\n<li>\n<p>Add a new target to your Xcode project with any Extension template. Then, change the values under the <code>NSExtension<\/code> dictionary in the <code>Info.plist<\/code> as follows:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>NSExtension<\/code><\/td>\n<td>String<\/td>\n<td><span translate=\"no\"><strong>com.apple.PassKit.issuer-provisioning<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td><code>NSExtensionPrincipalClass<\/code><\/td>\n<td>String<\/td>\n<td><span translate=\"no\"><strong>$(PRODUCT_MODULE_NAME).ExtensionHandler<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>Create an <code>ExtensionHandler<\/code> class that implements the <code>PKIssuerProvisioningExtensionHandler<\/code> protocol. This class manages the issuer-provided extension that is used during the card provisioning process.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Add Wallet extension'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import PassKit\\n\\nclass ExtensionHandler: PKIssuerProvisioningExtensionHandler {\\n\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<h3 id=\"add-auth-extension\">Add the Authentication UI extension<\/h3>\n<p>The Apple Wallet authenticates cardholders before allowing them to provision cards. You can implement this authentication process in your UI by adding the Authentication UI extension. To add this extension:<\/p>\n<ol>\n<li>\n<p>Add another target to your Xcode project with any Extension template. Change the values under the <code>NSExtension<\/code> dictionary in the <code>Info.plist<\/code> as follows:<\/p>\n<table>\n<thead>\n<tr>\n<th>Key<\/th>\n<th>Type<\/th>\n<th>Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>NSExtension<\/code><\/td>\n<td>String<\/td>\n<td><span translate=\"no\"><strong>com.apple.PassKit.issuer-provisioning.authorization<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td><code>NSExtensionPrincipalClass<\/code><\/td>\n<td>String<\/td>\n<td><span translate=\"no\"><strong>$(PRODUCT_MODULE_NAME).AuthorizationProvider<\/strong><\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>Create an <code>AuthorizationProvider<\/code> class that is a subclass of <code>UIViewController<\/code> and implements the <code>PKIssuerProvisioningExtensionAuthorizationProviding<\/code> protocol. Use the <code>completionHandler<\/code> to communicate if the authentication was successful.<\/p>\n<\/li>\n<\/ol>\n<h2>Initialize the Adyen Apple Pay Provisioning SDK<\/h2>\n<p>At the beginning of each step of the provisioning flow, you must initialize the <strong>Adyen Apple Pay Provisioning SDK<\/strong>, so you can call the SDK's methods. The following sequence diagram shows the flow to initialize the SDK.<\/p>\n<p><img alt=\"\" src=\"\/media\/f23fc312800592e8bc37e962b92c4d1f17dc93d19d166f27c4a5e76e595ce8ba.svg?decoding=auto&amp;fetchpriority=auto\" \/><\/p>\n<p>As shown in the diagram, the initialization flow is the following:<\/p>\n<ol>\n<li>Make a GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request.<\/li>\n<li>Receive an <code>sdkInput<\/code> from Adyen.<\/li>\n<li>Initialize the <code>ExtensionProvisioningService<\/code> using the <code>sdkInput<\/code>.<\/li>\n<\/ol>\n<p>The following sections explain the steps for the provisioning flow, including the steps to initialize the SDK.<\/p>\n<h2 id=\"show-your-app-on-wallet\">Show your app on Apple Wallet<\/h2>\n<p>When your user tries to add their Adyen-issued card from Apple Wallet, Apple Wallet must show your app as an option. To do this, Apple Wallet uses the <a href=\"#add-wallet-extension\">Apple Wallet extension<\/a> to check if your app supports pull provisioning from Apple Wallet. If your app has cards available to add, Apple Wallet shows it as an option.<\/p>\n<p>You can provide your app's availability for pull provisioning from Apple Wallet by using the <strong>Adyen Apple Pay Provisioning SDK<\/strong>. Do this as follows:<\/p>\n<ol>\n<li>\n<p>From your server, make a GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request and specify the <code>id<\/code> of the payment instrument in the path.<br \/>\nIf your user has multiple payment instruments, make a request for each payment instrument.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get activation data'\" :id=\"'get-activation-data'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/paymentInstruments\\\/PI00000000000000000000001\\\/networkTokenActivationData \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X GET&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v38.0.0 to latest\\nimport com.adyen.Client;\\nimport com.adyen.Config;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.*;\\nimport com.adyen.service.*;\\nimport java.math.*;\\nimport com.adyen.model.balanceplatform.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.service.balanceplatform.*;\\n\\nConfig config = new Config()\\n    .apiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;)\\n    .environment(Environment.TEST);\\nClient client = new Client(config);\\n\\\/\\\/ Send the request\\nPaymentInstrumentsApi service = new PaymentInstrumentsApi(client);\\nNetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData(\\&quot;id\\&quot;, null);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v30.0.0 to latest\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Service\\\\BalancePlatform\\\\PaymentInstrumentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;);\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentInstrumentsApi($client);\\n$response = $service-&gt;getNetworkTokenActivationData('id');&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .NET API Library v34.0.0 to latest\\nusing Adyen.BalancePlatform.Extensions;\\nusing Adyen.BalancePlatform.Models;\\nusing Adyen.BalancePlatform.Services;\\nusing Adyen.Core.Client;\\nusing Adyen.Core.Client.Extensions;\\nusing Adyen.Core.Options;\\nusing Microsoft.Extensions.DependencyInjection;\\nusing Microsoft.Extensions.Hosting;\\n\\nvar host = Host.CreateDefaultBuilder()\\n    .ConfigureBalancePlatform(\\n        (context, services, config) =&gt;\\n        {\\n            config.ConfigureAdyenOptions(options =&gt;\\n            {\\n                options.AdyenApiKey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;;\\n                options.Environment = AdyenEnvironment.Test;\\n            });\\n            services.AddAllBalancePlatformServices();\\n        })\\n    .Build();\\n\\nvar paymentInstrumentsService = host.Services.GetRequiredService&lt;IPaymentInstrumentsService&gt;();\\n\\n\\\/\\\/ Send the request\\nvar result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync(\\&quot;id\\&quot;);\\n\\nif (result.TryDeserializeOkResponse(out var response))\\n{\\n    \\\/\\\/ Handle the successful response.\\n}&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nconst { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen\\\/api-library');\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v21.0.0 to latest\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n)\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Send the request\\nservice := client.BalancePlatform()\\nreq := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput(\\&quot;id\\&quot;)\\nres, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v14.0.0 to latest\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Send the request\\nresult = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id=\\&quot;id\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v11.0.0 to latest\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Send the request\\nresult = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id')&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nimport { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response contains the <code>sdkInput<\/code> string that you need to initialize the provisioning service in the next step.<\/p>\n<\/li>\n<li>\n<p>Initialize the <code>ExtensionProvisioningService<\/code> class, which manages the <a href=\"#add-wallet-extension\">Apple Wallet extension<\/a>. Pass the <code>sdkInput<\/code> to the class as a parameter.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for one payment instrument'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInput: sdkInput)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If you requested multiple <code>sdkInput<\/code> strings, pass them to the class in an array.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for multiple payment instruments'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...])\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>From the <strong>Adyen Apple Pay Provisioning SDK<\/strong>, call <code>extensionStatus<\/code> to implement the <code>status<\/code> method of the <code>PKIssuerProvisioningExtensionHandler<\/code> protocol. Consider including the following parameters:<\/p>\n<ul>\n<li><code>requiresAuthentication<\/code>: A boolean that specifies whether you provide <a href=\"#add-auth-extension\">authentication through the UI extension<\/a>.<\/li>\n<li><code>entriesUnavailableExtensionStatus<\/code>: If the <code>ExtensionProvisioningService<\/code> could not be initialized, return this parameter to indicate that the provisioning service is not available.<\/li>\n<\/ul>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get current status'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"func status() async -&gt; PKIssuerProvisioningExtensionStatus {\\n    \\\/\\\/ Initialize the service\\n    return provisioningService.extensionStatus(requiresAuthentication: true)\\n\\n    \\\/\\\/ If service could not be initialized\\n    return ExtensionProvisioningService.entriesUnavailableExtensionStatus\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<p>After completing these steps, the <strong>Adyen Apple Pay Provisioning SDK<\/strong> sends the status to the Apple Wallet extension. If your provisioning service is available, the <code>status<\/code> object contains information about the available <a href=\"#show-card-passes\">card passes<\/a> in your app.<\/p>\n<div class=\"notices yellow\">\n<p>The time limit for your app to complete these steps is 100 milliseconds. If your app exceeds this limit, make a new GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request to refresh the <code>sdkInput<\/code>.<\/p>\n<\/div>\n<h2 id=\"show-card-passes\">Show card passes<\/h2>\n<p>To enable your user to add their card to their Apple Wallet, you must show the cards as available card passes. You can do this by providing the card data and card art to <strong>Adyen Apple Pay Provisioning SDK<\/strong>. With this information, the SDK generates a preview of the card passes to the user.<\/p>\n<p>The SDK uses two different methods to generate the available card passes:<\/p>\n<ul>\n<li><code>passEntries<\/code>: This method shows card passes on the Wallet app on iPhone.<\/li>\n<li><code>remotePassEntries<\/code>: This method shows card passes on:\n<ul>\n<li>The Watch app on iPhone.<\/li>\n<li>The Wallet app on Apple Watch.<\/li>\n<\/ul><\/li>\n<\/ul>\n<p>To implement <code>passEntries<\/code> and <code>remotePassEntries<\/code>:<\/p>\n<ol>\n<li>\n<p>From your server, make a GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request and specify the <code>id<\/code> of the payment instrument in the path.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get activation data'\" :id=\"'get-activation-data'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/paymentInstruments\\\/PI00000000000000000000001\\\/networkTokenActivationData \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X GET&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v38.0.0 to latest\\nimport com.adyen.Client;\\nimport com.adyen.Config;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.*;\\nimport com.adyen.service.*;\\nimport java.math.*;\\nimport com.adyen.model.balanceplatform.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.service.balanceplatform.*;\\n\\nConfig config = new Config()\\n    .apiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;)\\n    .environment(Environment.TEST);\\nClient client = new Client(config);\\n\\\/\\\/ Send the request\\nPaymentInstrumentsApi service = new PaymentInstrumentsApi(client);\\nNetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData(\\&quot;id\\&quot;, null);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v30.0.0 to latest\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Service\\\\BalancePlatform\\\\PaymentInstrumentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;);\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentInstrumentsApi($client);\\n$response = $service-&gt;getNetworkTokenActivationData('id');&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .NET API Library v34.0.0 to latest\\nusing Adyen.BalancePlatform.Extensions;\\nusing Adyen.BalancePlatform.Models;\\nusing Adyen.BalancePlatform.Services;\\nusing Adyen.Core.Client;\\nusing Adyen.Core.Client.Extensions;\\nusing Adyen.Core.Options;\\nusing Microsoft.Extensions.DependencyInjection;\\nusing Microsoft.Extensions.Hosting;\\n\\nvar host = Host.CreateDefaultBuilder()\\n    .ConfigureBalancePlatform(\\n        (context, services, config) =&gt;\\n        {\\n            config.ConfigureAdyenOptions(options =&gt;\\n            {\\n                options.AdyenApiKey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;;\\n                options.Environment = AdyenEnvironment.Test;\\n            });\\n            services.AddAllBalancePlatformServices();\\n        })\\n    .Build();\\n\\nvar paymentInstrumentsService = host.Services.GetRequiredService&lt;IPaymentInstrumentsService&gt;();\\n\\n\\\/\\\/ Send the request\\nvar result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync(\\&quot;id\\&quot;);\\n\\nif (result.TryDeserializeOkResponse(out var response))\\n{\\n    \\\/\\\/ Handle the successful response.\\n}&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nconst { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen\\\/api-library');\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v21.0.0 to latest\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n)\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Send the request\\nservice := client.BalancePlatform()\\nreq := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput(\\&quot;id\\&quot;)\\nres, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v14.0.0 to latest\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Send the request\\nresult = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id=\\&quot;id\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v11.0.0 to latest\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Send the request\\nresult = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id')&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nimport { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response contains the <code>sdkInput<\/code> string that you need to initialize the provisioning service in the next step.  If the extension needs to show multiple payment instruments, request an <code>sdkInput<\/code> string for each payment instrument.<\/p>\n<\/li>\n<li>\n<p>Initialize the <code>ExtensionProvisioningService<\/code> class, which manages the <a href=\"#add-wallet-extension\">Apple Wallet extension<\/a>. Pass the <code>sdkInput<\/code> to the class as a parameter.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for one payment instrument'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInput: sdkInput)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If you requested multiple <code>sdkInput<\/code>, pass these to the class in an array.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for multiple payment instruments'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...])\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Implement <code>ExtensionProvisioningServiceDelegate<\/code> to receive the <code>cardArt(forBrand: String)<\/code> callback from the <strong>Adyen Apple Pay Provisioning SDK<\/strong>. This callback returns the card art that corresponds to each available card pass.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Provide card art'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"extension ExtensionHandler: ExtensionProvisioningServiceDelegate {\\n    func cardArt(forBrand brand: String) -&gt; CGImage {\\n        return UIImage(named: \\\"card_art\\\")!.cgImage!\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>From the SDK, call <code>passEntries<\/code> and <code>remotePassEntries<\/code> and pass the delegate that you created in the previous step.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get pass entries'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"func passEntries() async -&gt; [PKIssuerProvisioningExtensionPassEntry] {\\n    return provisioningService.passEntries(withDelegate: self)\\n}\\n\\nfunc remotePassEntries() async -&gt; [PKIssuerProvisioningExtensionPassEntry] {\\n    return provisioningService.remotePassEntries(withDelegate: self)\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<\/ol>\n<p>Now, the Apple Wallet or Watch app shows the available card passes to your user.<\/p>\n<div class=\"notices yellow\">\n<p>The time limit for your app to complete these steps is 20 seconds. If your app exceeds this limit, make a new GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request to refresh the <code>sdkInput<\/code>.<\/p>\n<\/div>\n<h2 id=\"start-provisioning-process\">Start pull provisioning from Apple Wallet<\/h2>\n<p>After your user selects to add a card to Apple Wallet, the Apple Wallet extension calls <strong>Adyen Apple Pay Provisioning SDK<\/strong> to generate a request to provision the card pass.<\/p>\n<p>To generate a request for adding a card:<\/p>\n<ol>\n<li>\n<p>From your server, make a GET <code>\/paymentInstruments\/{id}\/networkTokenActivationData<\/code> request and specify the <code>id<\/code> of the payment instrument in the path.<br \/>\nIf your user has multiple payment instruments, make a request for each payment instrument.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Get activation data'\" :id=\"'get-activation-data'\" :code-data=\"[{&quot;language&quot;:&quot;bash&quot;,&quot;tabTitle&quot;:&quot;curl&quot;,&quot;content&quot;:&quot;curl https:\\\/\\\/balanceplatform-api-test.adyen.com\\\/bcl\\\/v2\\\/paymentInstruments\\\/PI00000000000000000000001\\\/networkTokenActivationData \\\\\\n-H 'x-api-key: ADYEN_BALANCE_PLATFORM_API_KEY' \\\\\\n-H 'content-type: application\\\/json' \\\\\\n-X GET&quot;},{&quot;language&quot;:&quot;java&quot;,&quot;tabTitle&quot;:&quot;Java&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Java API Library v38.0.0 to latest\\nimport com.adyen.Client;\\nimport com.adyen.Config;\\nimport com.adyen.enums.Environment;\\nimport com.adyen.model.*;\\nimport com.adyen.service.*;\\nimport java.math.*;\\nimport com.adyen.model.balanceplatform.*;\\nimport java.time.OffsetDateTime;\\nimport java.util.*;\\nimport com.adyen.service.balanceplatform.*;\\n\\nConfig config = new Config()\\n    .apiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;)\\n    .environment(Environment.TEST);\\nClient client = new Client(config);\\n\\\/\\\/ Send the request\\nPaymentInstrumentsApi service = new PaymentInstrumentsApi(client);\\nNetworkTokenActivationDataResponse response = service.getNetworkTokenActivationData(\\&quot;id\\&quot;, null);&quot;},{&quot;language&quot;:&quot;php&quot;,&quot;tabTitle&quot;:&quot;PHP&quot;,&quot;content&quot;:&quot;&lt;?php\\n\\\/\\\/ Adyen PHP API Library v30.0.0 to latest\\nuse Adyen\\\\Client;\\nuse Adyen\\\\Environment;\\nuse Adyen\\\\Service\\\\BalancePlatform\\\\PaymentInstrumentsApi;\\n\\n$client = new Client();\\n$client-&gt;setXApiKey(\\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;);\\n$client-&gt;setEnvironment(Environment::TEST);\\n\\n\\\/\\\/ Send the request\\n$service = new PaymentInstrumentsApi($client);\\n$response = $service-&gt;getNetworkTokenActivationData('id');&quot;},{&quot;language&quot;:&quot;cs&quot;,&quot;tabTitle&quot;:&quot;C#&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen .NET API Library v34.0.0 to latest\\nusing Adyen.BalancePlatform.Extensions;\\nusing Adyen.BalancePlatform.Models;\\nusing Adyen.BalancePlatform.Services;\\nusing Adyen.Core.Client;\\nusing Adyen.Core.Client.Extensions;\\nusing Adyen.Core.Options;\\nusing Microsoft.Extensions.DependencyInjection;\\nusing Microsoft.Extensions.Hosting;\\n\\nvar host = Host.CreateDefaultBuilder()\\n    .ConfigureBalancePlatform(\\n        (context, services, config) =&gt;\\n        {\\n            config.ConfigureAdyenOptions(options =&gt;\\n            {\\n                options.AdyenApiKey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;;\\n                options.Environment = AdyenEnvironment.Test;\\n            });\\n            services.AddAllBalancePlatformServices();\\n        })\\n    .Build();\\n\\nvar paymentInstrumentsService = host.Services.GetRequiredService&lt;IPaymentInstrumentsService&gt;();\\n\\n\\\/\\\/ Send the request\\nvar result = await paymentInstrumentsService.GetNetworkTokenActivationDataAsync(\\&quot;id\\&quot;);\\n\\nif (result.TryDeserializeOkResponse(out var response))\\n{\\n    \\\/\\\/ Handle the successful response.\\n}&quot;},{&quot;language&quot;:&quot;js&quot;,&quot;tabTitle&quot;:&quot;NodeJS (JavaScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nconst { Client, Config, EnvironmentEnum, BalancePlatformAPI } = require('@adyen\\\/api-library');\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;},{&quot;language&quot;:&quot;go&quot;,&quot;tabTitle&quot;:&quot;Go&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Go API Library v21.0.0 to latest\\nimport (\\n  \\&quot;context\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/common\\&quot;\\n  \\&quot;github.com\\\/adyen\\\/adyen-go-api-library\\\/v21\\\/src\\\/adyen\\&quot;\\n)\\nclient := adyen.NewClient(&amp;common.Config{\\n  ApiKey:      \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  Environment: common.TestEnv,\\n})\\n\\n\\\/\\\/ Send the request\\nservice := client.BalancePlatform()\\nreq := service.PaymentInstrumentsApi.GetNetworkTokenActivationDataInput(\\&quot;id\\&quot;)\\nres, httpRes, err := service.PaymentInstrumentsApi.GetNetworkTokenActivationData(context.Background(), req)&quot;},{&quot;language&quot;:&quot;py&quot;,&quot;tabTitle&quot;:&quot;Python&quot;,&quot;content&quot;:&quot;# Adyen Python API Library v14.0.0 to latest\\nimport Adyen\\n\\nadyen = Adyen.Adyen()\\nadyen.client.xapikey = \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;\\nadyen.client.platform = \\&quot;test\\&quot; # The environment to use library in.\\n\\n# Send the request\\nresult = adyen.balancePlatform.payment_instruments_api.get_network_token_activation_data(id=\\&quot;id\\&quot;)&quot;},{&quot;language&quot;:&quot;rb&quot;,&quot;tabTitle&quot;:&quot;Ruby&quot;,&quot;content&quot;:&quot;# Adyen Ruby API Library v11.0.0 to latest\\nrequire \\&quot;adyen-ruby-api-library\\&quot;\\n\\nadyen = Adyen::Client.new\\nadyen.api_key = 'ADYEN_BALANCE_PLATFORM_API_KEY'\\nadyen.env = :test # Set to \\&quot;live\\&quot; for live environment\\n\\n# Send the request\\nresult = adyen.balance_platform.payment_instruments_api.get_network_token_activation_data('id')&quot;},{&quot;language&quot;:&quot;ts&quot;,&quot;tabTitle&quot;:&quot;NodeJS (TypeScript)&quot;,&quot;content&quot;:&quot;\\\/\\\/ Adyen Node API Library v30.0.0 to latest\\nimport { Client, Config, EnvironmentEnum, BalancePlatformAPI, Types } from \\&quot;@adyen\\\/api-library\\&quot;;\\n\\nconst config = new Config({\\n  apiKey: \\&quot;ADYEN_BALANCE_PLATFORM_API_KEY\\&quot;,\\n  environment: EnvironmentEnum.TEST\\n});\\n\\nconst client = new Client(config);\\n\\n\\\/\\\/ Send the request\\nconst balancePlatformAPI = new BalancePlatformAPI(client);\\nconst response = await balancePlatformAPI.PaymentInstrumentsApi.getNetworkTokenActivationData(\\&quot;id\\&quot;);&quot;}]\" :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>The response contains the <code>sdkInput<\/code> string that you need to initialize the provisioning service in the next step.<\/p>\n<\/li>\n<li>\n<p>Initialize the <code>ExtensionProvisioningService<\/code> class, which manages the <a href=\"#add-wallet-extension\">Apple Wallet extension<\/a>. Pass the <code>sdkInput<\/code> to the class as a parameter.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for one payment instrument'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInput: sdkInput)\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>If you requested multiple <code>sdkInput<\/code> strings, pass these to the class in an array.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Initiate card provisioning for multiple payment instruments'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"import AdyenApplePayExtensionProvisioning\\n\\nlet provisioningService = ExtensionProvisioningService(sdkInputs: [sdkInput1, sdkInput2, ...])\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>From the SDK, call the <code>generateAddPaymentPassRequestForPassEntryWithIdentifier<\/code> method to obtain a pass request. In this call, include the <code>delegate<\/code> parameter to handle <a href=\"#add-card\">card provisioning<\/a>.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"'Generate a request for adding a card pass'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"func generateAddPaymentPassRequestForPassEntryWithIdentifier(\\n    _ identifier: String,\\n    configuration: PKAddPaymentPassRequestConfiguration,\\n    certificateChain certificates: [Data],\\n    nonce: Data,\\n    nonceSignature: Data\\n) async -&gt; PKAddPaymentPassRequest? {\\n    try? await provisioningService.generateAddPaymentPassRequestForPassEntryWithIdentifier(\\n        identifier,\\n        configuration: configuration,\\n        certificateChain: certificates,\\n        nonce: nonce,\\n        nonceSignature: nonceSignature,\\n        delegate: self\\n    )\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>Send the pass request to the extension.<\/p>\n<\/li>\n<\/ol>\n<h2 id=\"add-card\">Add the card to Apple Wallet<\/h2>\n<p>After the SDK sends the pass request to the Apple Wallet extension, the extension requests from Adyen the <a href=\"\/issuing\/manage-network-tokens\">network token<\/a> data of the card. The extension uses this data to provision the card in Apple Wallet.<\/p>\n<p>To provision the card when the extension requests it:<\/p>\n<ol>\n<li>Implement <code>ExtensionProvisioningServiceDelegate<\/code> to receive the <code>provision(paymentInstrumentId, sdkOutput)<\/code> callback from the <strong>Adyen Apple Pay Provisioning SDK<\/strong>.<\/li>\n<li>\n<p>In the callback, make a POST <code>paymentInstruments\/{id}\/networkTokenActivationData<\/code> request and specify the following parameters:<\/p>\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>id<\/code><\/td>\n<td>Path<\/td>\n<td>The <code>paymentInstrumentId<\/code> of the card you want to provision.<\/td>\n<\/tr>\n<tr>\n<td><code>sdkOutput<\/code><\/td>\n<td>Body<\/td>\n<td>Data automatically generated and provided by the SDK. The extension must send this data to Adyen to validate the request.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The response contains the <code>sdkInput<\/code> string that the SDK needs to provision the card.<\/p>\n<\/li>\n<li>Return the <code>sdkInput<\/code> string from the response back to the SDK.<\/li>\n<\/ol>\n<p>The following example shows how to implement these steps.<\/p>\n<div data-component-wrapper=\"code-sample\">\n    <code-sample :title=\"'Provision the card'\" :id=\"''\" :code-data='[{\"language\":\"swift\",\"tabTitle\":\"\",\"content\":\"extension ExtensionHandler: ExtensionProvisioningServiceDelegate {\\n    func provision(paymentInstrumentId: String, sdkOutput: Data) async -&gt; Data? {\\n        let sdkInput = \\\/\\\/ POST `sdkOutput` to server\\n        return sdkInput\\n    }\\n}\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<p>After these steps are completed, the SDK returns the delegate to the Apple Wallet extension. Then, the extension provisions the card on Apple Wallet.<\/p>","url":"https:\/\/docs.adyen.com\/issuing\/tokens-digital-wallet\/wallet-provisioning","articleFields":{"description":"Learn how to allow your cardholders to add their Adyen-issued card to Apple Wallet from the Apple Wallet app.","robots":"noindex,nofollow","feedback_component":true,"filters_component":false,"last_edit_on":"28-03-2023 14:00","next_steps":[{"title":"Manage network tokens","description":"Learn how to manage network tokens for cards added to digital wallets.","url":"\/issuing\/manage-network-tokens","required":true}],"parameters":{"directoryPath":"\/issuing"},"page_id":"58a615ab-414f-4e89-a3a1-fcc9266c1c13","decision_tree":"[]"},"algolia":{"url":"https:\/\/docs.adyen.com\/issuing\/tokens-digital-wallet\/wallet-provisioning","title":"Pull provisioning from Apple Wallet","content":"In addition to in-app push provisioning, you must also support pull provisioning from Apple Wallet. After implementing the Apple Wallet extension, your app's name and icon appears in the From Apps on Your iPhone list of cards available to add to the Wallet.\n\nIf you are integrating pull provisioning from Apple Wallet, you must also integrate in-app push provisioning for Apple Pay.\n\nRequirements\nBefore you begin, take into account the following requirements, limitations, and preparations.\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nYou need an integration that supports Adyen Issuing.\n\n\nAPI credentials\nYour API credential must have the following role:Bank Issuing PaymentInstrument Network Token Activation Data role\n\n\nLimitations\nYour app must target iOS 13.4 or later. Your development environment must use Xcode 14 or later and Swift 5.7 or later.\n\n\nSetup steps\nInstall the Adyen Apple Pay Provisioning SDK following the instructions in the repository's README file.\n\n\n\nExtension provisioning flow\nThe following sequence diagram shows the flow for pull provisioning from Apple Wallet.\n\nAs shown in the diagram, the provisioning flow is the following:\n\nShow your app on Apple Wallet\nShow card passes\nGenerate a request to add a card\nProvision the card\n\nAdd Apple extensions\nBefore you implement pull provisioning from Apple Wallet:\n\nAdd the Apple Wallet extension.\nAdd Authentication UI extension.\n\nAdd the Apple Wallet extension\nTo add the Apple Wallet extension:\n\n\nAdd a new target to your Xcode project with any Extension template. Then, change the values under the NSExtension dictionary in the Info.plist as follows:\n\n\n\nKey\nType\nValue\n\n\n\n\nNSExtension\nString\ncom.apple.PassKit.issuer-provisioning\n\n\nNSExtensionPrincipalClass\nString\n$(PRODUCT_MODULE_NAME).ExtensionHandler\n\n\n\n\n\nCreate an ExtensionHandler class that implements the PKIssuerProvisioningExtensionHandler protocol. This class manages the issuer-provided extension that is used during the card provisioning process.\n\n\n\n\n\nAdd the Authentication UI extension\nThe Apple Wallet authenticates cardholders before allowing them to provision cards. You can implement this authentication process in your UI by adding the Authentication UI extension. To add this extension:\n\n\nAdd another target to your Xcode project with any Extension template. Change the values under the NSExtension dictionary in the Info.plist as follows:\n\n\n\nKey\nType\nValue\n\n\n\n\nNSExtension\nString\ncom.apple.PassKit.issuer-provisioning.authorization\n\n\nNSExtensionPrincipalClass\nString\n$(PRODUCT_MODULE_NAME).AuthorizationProvider\n\n\n\n\n\nCreate an AuthorizationProvider class that is a subclass of UIViewController and implements the PKIssuerProvisioningExtensionAuthorizationProviding protocol. Use the completionHandler to communicate if the authentication was successful.\n\n\nInitialize the Adyen Apple Pay Provisioning SDK\nAt the beginning of each step of the provisioning flow, you must initialize the Adyen Apple Pay Provisioning SDK, so you can call the SDK's methods. The following sequence diagram shows the flow to initialize the SDK.\n\nAs shown in the diagram, the initialization flow is the following:\n\nMake a GET \/paymentInstruments\/{id}\/networkTokenActivationData request.\nReceive an sdkInput from Adyen.\nInitialize the ExtensionProvisioningService using the sdkInput.\n\nThe following sections explain the steps for the provisioning flow, including the steps to initialize the SDK.\nShow your app on Apple Wallet\nWhen your user tries to add their Adyen-issued card from Apple Wallet, Apple Wallet must show your app as an option. To do this, Apple Wallet uses the Apple Wallet extension to check if your app supports pull provisioning from Apple Wallet. If your app has cards available to add, Apple Wallet shows it as an option.\nYou can provide your app's availability for pull provisioning from Apple Wallet by using the Adyen Apple Pay Provisioning SDK. Do this as follows:\n\n\nFrom your server, make a GET \/paymentInstruments\/{id}\/networkTokenActivationData request and specify the id of the payment instrument in the path.\nIf your user has multiple payment instruments, make a request for each payment instrument.\n\n\n\nThe response contains the sdkInput string that you need to initialize the provisioning service in the next step.\n\n\nInitialize the ExtensionProvisioningService class, which manages the Apple Wallet extension. Pass the sdkInput to the class as a parameter.\n\n\n\nIf you requested multiple sdkInput strings, pass them to the class in an array.\n\n\n\n\n\nFrom the Adyen Apple Pay Provisioning SDK, call extensionStatus to implement the status method of the PKIssuerProvisioningExtensionHandler protocol. Consider including the following parameters:\n\nrequiresAuthentication: A boolean that specifies whether you provide authentication through the UI extension.\nentriesUnavailableExtensionStatus: If the ExtensionProvisioningService could not be initialized, return this parameter to indicate that the provisioning service is not available.\n\n\n\n\n\n\nAfter completing these steps, the Adyen Apple Pay Provisioning SDK sends the status to the Apple Wallet extension. If your provisioning service is available, the status object contains information about the available card passes in your app.\n\nThe time limit for your app to complete these steps is 100 milliseconds. If your app exceeds this limit, make a new GET \/paymentInstruments\/{id}\/networkTokenActivationData request to refresh the sdkInput.\n\nShow card passes\nTo enable your user to add their card to their Apple Wallet, you must show the cards as available card passes. You can do this by providing the card data and card art to Adyen Apple Pay Provisioning SDK. With this information, the SDK generates a preview of the card passes to the user.\nThe SDK uses two different methods to generate the available card passes:\n\npassEntries: This method shows card passes on the Wallet app on iPhone.\nremotePassEntries: This method shows card passes on:\n\nThe Watch app on iPhone.\nThe Wallet app on Apple Watch.\n\n\nTo implement passEntries and remotePassEntries:\n\n\nFrom your server, make a GET \/paymentInstruments\/{id}\/networkTokenActivationData request and specify the id of the payment instrument in the path.\n\n\n\nThe response contains the sdkInput string that you need to initialize the provisioning service in the next step.  If the extension needs to show multiple payment instruments, request an sdkInput string for each payment instrument.\n\n\nInitialize the ExtensionProvisioningService class, which manages the Apple Wallet extension. Pass the sdkInput to the class as a parameter.\n\n\n\nIf you requested multiple sdkInput, pass these to the class in an array.\n\n\n\n\n\nImplement ExtensionProvisioningServiceDelegate to receive the cardArt(forBrand: String) callback from the Adyen Apple Pay Provisioning SDK. This callback returns the card art that corresponds to each available card pass.\n\n\n\n\n\nFrom the SDK, call passEntries and remotePassEntries and pass the delegate that you created in the previous step.\n\n\n\n\n\nNow, the Apple Wallet or Watch app shows the available card passes to your user.\n\nThe time limit for your app to complete these steps is 20 seconds. If your app exceeds this limit, make a new GET \/paymentInstruments\/{id}\/networkTokenActivationData request to refresh the sdkInput.\n\nStart pull provisioning from Apple Wallet\nAfter your user selects to add a card to Apple Wallet, the Apple Wallet extension calls Adyen Apple Pay Provisioning SDK to generate a request to provision the card pass.\nTo generate a request for adding a card:\n\n\nFrom your server, make a GET \/paymentInstruments\/{id}\/networkTokenActivationData request and specify the id of the payment instrument in the path.\nIf your user has multiple payment instruments, make a request for each payment instrument.\n\n\n\nThe response contains the sdkInput string that you need to initialize the provisioning service in the next step.\n\n\nInitialize the ExtensionProvisioningService class, which manages the Apple Wallet extension. Pass the sdkInput to the class as a parameter.\n\n\n\nIf you requested multiple sdkInput strings, pass these to the class in an array.\n\n\n\n\n\nFrom the SDK, call the generateAddPaymentPassRequestForPassEntryWithIdentifier method to obtain a pass request. In this call, include the delegate parameter to handle card provisioning.\n\n\n\n\n\nSend the pass request to the extension.\n\n\nAdd the card to Apple Wallet\nAfter the SDK sends the pass request to the Apple Wallet extension, the extension requests from Adyen the network token data of the card. The extension uses this data to provision the card in Apple Wallet.\nTo provision the card when the extension requests it:\n\nImplement ExtensionProvisioningServiceDelegate to receive the provision(paymentInstrumentId, sdkOutput) callback from the Adyen Apple Pay Provisioning SDK.\n\nIn the callback, make a POST paymentInstruments\/{id}\/networkTokenActivationData request and specify the following parameters:\n\n\n\nParameter\nType\nDescription\n\n\n\n\nid\nPath\nThe paymentInstrumentId of the card you want to provision.\n\n\nsdkOutput\nBody\nData automatically generated and provided by the SDK. The extension must send this data to Adyen to validate the request.\n\n\n\nThe response contains the sdkInput string that the SDK needs to provision the card.\n\nReturn the sdkInput string from the response back to the SDK.\n\nThe following example shows how to implement these steps.\n\n    \n\nAfter these steps are completed, the SDK returns the delegate to the Apple Wallet extension. Then, the extension provisions the card on Apple Wallet.","type":"page","locale":"en","boost":17,"hierarchy":{"lvl0":"Home","lvl1":"Adyen Issuing","lvl2":"Network tokens for digital wallets","lvl3":"Pull provisioning from Apple Wallet"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/issuing","lvl2":"https:\/\/docs.adyen.com\/issuing\/tokens-digital-wallet","lvl3":"\/issuing\/tokens-digital-wallet\/wallet-provisioning"},"levels":4,"category":"Issuing","category_color":"green","tags":["provisioning","Apple","Wallet"]},"articleFiles":{"extension-flow.svg":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/media\/d6f57ae0e388507882b3c96fb97c083ee6c7125ef4dc173b4e81b1d4a0bd25da.svg?decoding=auto&amp;fetchpriority=auto\" \/>","get-activation-data.js":"<p alt=\"\">get-activation-data.js<\/p>","initialize-sdk.svg":"<img alt=\"\" src=\"https:\/\/docs.adyen.com\/media\/f23fc312800592e8bc37e962b92c4d1f17dc93d19d166f27c4a5e76e595ce8ba.svg?decoding=auto&amp;fetchpriority=auto\" \/>"}}
