{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"e9f5ba30-86a8-4709-b5a8-a7bd930f0384","name":"Mobile payments (Apple Pay)","description":"## Apple Pay®, In-App and In-Web\n\n#### Prerequisites:\n\n1. The merchant must be successfully onboarded to MPPGv4/v3, and have claim access to one (or both) of the operations:\n    \n    1. `ProcessInAppApplePay` (In-App).\n        \n    2. `ProcessTecApplePay` (In-Web).\n        \n2. _Only for In-App_: The merchant must have an active Apple Merchant Id; which was set up using the CSR (Certificate Signing Request) obtained during the Magensa onboarding process.\n    \n    1. More information on the Merchant Id registration process in section 1.2.2\n        \n\nMPPGv4/v3's `ProcessInAppApplePay` operation exclusively supports the \"SALE\" transaction type for processing InApp ApplePay tokens.\n\nThe process of requesting MPPG to handle In-App ApplePay tokens is simple. Please refer to the sample request provided later in this document. However, to make this call, several steps need to be taken as part of building the iOS app and this document will provide the corresponding instructions.\n\n#### Purpose of the document:\n\nThe purpose of this document is to guide merchants and developers to integrating Apple Pay into an iOS app (In-App) or web app (In-Web). The Apple Pay tokens produced from the merchant's app will be processed through Magensa Payment Protection Gateway (MPPG v4/v3).\n\n## Table of Contents\n\n- Table of Contents\n    \n- 1.1 Apple Pay In-Web Payments\n    \n    - 1.1.1 Introduction\n        \n    - 1.1.2 Verification Set Up\n        \n    - 1.1.3 Client-Side Implementation\n        \n    - 1.1.4 MPPG Operation ProcessTecApplePay\n        \n- 1.2 Apple Pay In-App Payments\n    \n    - 2.2.1 Introduction\n        \n    - 2.2.2 Register an ApplePay Merchant Identifier\n        \n- See Create a merchant identifier for the setup steps.\n    \n    - 1.2.3 Step One - Register a new identifier\n        \n    - 1.2.4 Step Two - Register a Merchant ID\n        \n    - 1.2.5 Step Three - Register\n        \n    - 1.2.6 Create a new ApplePay Certificate\n        \n    - 1.2.6.1 Step One – Login to the Apple Developer Website\n        \n    - 1.2.6.2 Step two – Create Certificate\n        \n    - 1.2.6.3 Step Three – Payments in China\n        \n    - 1.2.6.4 Step Four – CSR File Upload\n        \n    - 1.2.7 Integrate with Xcode\n        \n    - 1.2.8 Enable the ApplePay capability in Xcode\n        \n    - 1.2.9 Send PKPaymentToken Data to MagTek\n        \n    - 1.2.10 “SALE” with InApp ApplePay token:\n        \n- Appendix\n    \n\n### 1.1 Apple Pay In-Web Payments\n\n#### 1.1.1 Introduction\n\nIn-web browser-based payments use TokenExchange Connect. Web app implementation for [TokenExchange Connect can be found here](https://github.com/Magensa/te-connect). Apple Pay In-Web requires domain validation with TokenExchange Connect setup. Use this guide for Token Exchange Connect Domain Verification.\n\n#### 1.1.2 Verification Set Up\n\nIn order to verify your web app's domain, follow the steps below.\n\n- ### Contact MagTek\n    \n    Contact MagTek to begin the on-boarding process. MagTek will provide a Domain Verification File.\n    \n- ### Host the Domain Verification File\n    \n    Host the domain verification file at the domain where you wish to host your web application(s):\n    \n\n`https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association`\n\nEnsure that the file is available at the path listed above. If you wish to register multiple domains – ensure the domain verification file is hosted at the path specified above for each domain you wish to register\n\n- ### Register Domain(s) with MagTek\n    \n    Once the Domain Verification File is hosted at the correct path mentioned above; contact MagTek to register the domain(s) to your account.\n    \n\n#### 1.1.3 Client-Side Implementation\n\nTokenExchange Connect offers various JavaScript implementations. [JavaScript implementation instructions can be found here](https://github.com/Magensa/te-connect).\n\n#### 1.1.4 MPPG Operation ProcessTecApplePay\n\nWeb applications using TokenExchange Connect's ApplePay feature will produce Apple Pay tokens. Use MPPG's `ProcessTecApplePay` to process these tokens.\n\n### 1.2 Apple Pay In-App Payments\n\n#### 1.2.1 Introduction\n\nMagensa Web Services provide a wide variety of payment options, including InApp payments, subscriptions, rewards, and loyalty programs.\n\nFamiliarize Yourself with ApplePay APIs: Gain a solid understanding of the ApplePay APIs by following the step-by-step instructions in the tutorial video available at: ApplePay API Configuration Tutorial. This video will guide you through configuring your Apple Developer Account to enable utilization of the ApplePay APIs.\n\n[https://developer.apple.com/videos/play/tutorials/configuring-your-developer-account-for-apple-pay/](https://developer.apple.com/videos/play/tutorials/configuring-your-developer-account-for-apple-pay/)\n\n#### 1.2.2 Register an ApplePay Merchant Identifier\n\nTo enable your app to use ApplePay, register an identifier with Apple that uniquely identifies your business as a merchant able to accept payments. This ID never expires and can be used in multiple websites and apps.\n\n### See Create a merchant identifier for the setup steps.\n\n#### 1.2.3 Step One - Register a new identifier\n\nSelect Merchant IDs\n\n<img src=\"https://content.pstmn.io/0a02bd40-3b65-4858-a216-354bd05d684d/Mi4yLjMucG5n\">\n\n#### 1.2.4 Step Two - Register a Merchant ID\n\nInput description and identifier.\n\n<img src=\"https://content.pstmn.io/88a6f670-a292-4c79-9f0f-b8155236a015/Mi4yLjQucG5n\">\n\n#### 1.2.5 Step Three - Register\n\nEnsure inputted information is accurate and click Register.\n\n<img src=\"https://content.pstmn.io/63b8d60f-5ffb-4a12-8c7e-6ee5d54481c0/Mi4yLjUucG5n\">\n\n#### 1.2.6 Create a new ApplePay Certificate\n\nA Certificate Signing Request (CSR) will be created for you at MagTek. Please upload this CSR to your Apple Developer account. This allows your app to encrypt payment data with MagTek’s CSR.\n\n#### 1.2.6.1 Step One – Login to the Apple Developer Website\n\nLogin at the Apple Developer website with your Apple ID and Click on Certificates, IDs & Profiles. Click Identifiers and then select Merchant IDs from the dropdown menu on the right. Click on your Merchant ID in the table.\n\n<img src=\"https://content.pstmn.io/96e8900b-3a4d-4b71-891d-d889316c2e3c/Mi4yLjYuMS5wbmc=\">\n\n#### 1.2.6.2 Step two – Create Certificate\n\nUnder the ApplePay Merchant Identity Certificate heading, click Create Certificate\n\n<img src=\"https://content.pstmn.io/872780a4-430f-4895-b148-f12966196866/Mi4yLjYuMi5wbmc=\">\n\n#### 1.2.6.3 Step Three – Payments in China\n\nSelect the appropriate option with regards to payments in China and click Continue.\n\n<img src=\"https://content.pstmn.io/3e544fc4-8175-43a3-8888-34c6184a686e/Mi4yLjYuMy5wbmc=\">\n\n#### 1.2.6.4 Step Four – CSR File Upload\n\nUpload the CSR file and click Continue.\n\n<img src=\"https://content.pstmn.io/749e2c9c-c158-4e3c-8a95-e6447919b644/Mi4yLjYuNC5wbmc=\">\n\n#### 1.2.7 Integrate with Xcode\n\nAdd the ApplePay capability to your app. In Xcode, open your project settings, click the Signing & Capabilities tab, and add the ApplePay capability. You might be prompted to log in to your developer account at this point. Select the merchant ID you created earlier, and your app is ready to accept ApplePay.\n\n#### 1.2.8 Enable the ApplePay capability in Xcode\n\n<img src=\"https://content.pstmn.io/f9070195-8444-4c90-bcc8-5559ed8ef963/Mi4yLjgucG5n\">\n\n#### 1.2.9 Send PKPaymentToken Data to MagTek\n\nYour mobile application forwards the PKPaymentToken from ApplePay to MagTek servers.\n\n<img src=\"https://content.pstmn.io/dea32d4c-2f51-47a4-994a-d57519a6b208/Mi4yLjkucG5n\">\n\n#### 1.2.10 “SALE” with InApp ApplePay token:\n\nSOAP request:\n\n``` xml\nxmlns:mpp=\"http://www.magensa.net/MPPGv4/\"\nxmlns:mpp1=\"http://schemas.datacontract.org/2004/07/MPPGv4WS.Core\"\nxmlns:sys=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">\n <soapenv:Header/>\n <soapenv:Body>\n <mpp:ProcessInAppApplePay>\n <mpp:ProcessInAppApplePayRequests>\n <mpp1:ProcessInAppApplePayRequest>\n <mpp1:ApplePayToken>{ApplePayToken}</mpp1:ApplePayToken>\n <mpp1:Authentication>\n <mpp1:CustomerCode>{CustomerCode}</mpp1:CustomerCode>\n <mpp1:Password>{Password}</mpp1:Password>\n <mpp1:Username>{Username}</mpp1:Username>\n </mpp1:Authentication>\n <mpp1:CustomerTransactionID>12345</mpp1:CustomerTransactionID>\n <mpp1:TransactionInput>\n <mpp1:Amount>1.00</mpp1:Amount>\n <mpp1:ProcessorName>{ProcessorName} </mpp1:ProcessorName>\n <mpp1:TransactionInputDetails>\n </mpp1:TransactionInputDetails>\n <mpp1:TransactionType>SALE</mpp1:TransactionType>\n </mpp1:TransactionInput>\n </mpp1:ProcessInAppApplePayRequest>\n </mpp:ProcessInAppApplePayRequests>\n </mpp:ProcessInAppApplePay>\n </soapenv:Body>\n</soapenv:Envelope>\n\n ```\n\n### Appendix\n\n- This model is designed to be implemented with a single merchant account; for other use cases, please contact MagTek.\n    \n- The tokens from ApplePay InApp transactions cannot be used with card on file transactions.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"33729815","team":6083045,"collectionId":"e9f5ba30-86a8-4709-b5a8-a7bd930f0384","publishedId":"2sAYdbNYfL","public":true,"publicUrl":"https://apple-mobile.developer.magtek.com","privateUrl":"https://go.postman.co/documentation/33729815-e9f5ba30-86a8-4709-b5a8-a7bd930f0384","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-single-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.1","publishDate":"2025-03-05T16:23:39.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/54710abbcbe0595b52ebedcdb464cfaf3ee177ca1c5a5d0850c1dc24c3508caf","favicon":"https://res.cloudinary.com/postman/image/upload/v1741199418/team/2b0e542073ba9f727998a67f8bd10fe7.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://apple-mobile.developer.magtek.com/view/metadata/2sAYdbNYfL"}