Register Apple Merchant ID following the instruction register merchant ID at Apple Developer site.
Fill out the form with a description and identifier. Your description is for your own needs and may be changed in the future (we recommend using the name of your mobile application). The identifier must be unique (in all Apple applications, not just yours) and cannot be changed later (although you can always create another). We recommend using merchant.{{Your_app_name}}. Keep this value for future reference when developing the application.
Detailed instruction:
1.1 Go to the Dashboard of your account in Apple Developer https://developer.apple.com/account/#
1.2 Open menu Certificates, Identifiers & Profiles
1.3 In menu Identifiers click + to create Merchant ID: https://developer.apple.com/account/resources/identifiers/add/bundleId
1.4 Fill out Description and Identifier (merchant.{{Your_app_name}}.):
You need to add the certificate to your application to encrypt payment data. To do this, follow 3 steps:
2.1 Provide the information necessary for generating the CSR file to the hutko support team. To do this, please fill in where the sign “?” is placed:
Country Name (2 letter code) [AU]: ?
State or Province Name (full name) [Some-State]: ?
Locality Name (eg, city) []: ?
Organization Name (eg, company) [Internet Widgits Pty Ltd]: ?
Organizational Unit Name (eg, section) []: ?
Common Name (e.g. server FQDN or YOUR name) []: ?
Email Address []: ?
2.2 Obtain 2 CSR files (Certificate Signing Request) from hutko:
Apple Pay Payment Processing Certificate Request
Apple Pay Merchant Identity Certificate Request
2.3 Use these CSR files to generate certificates to complete 1.4
Section Apple Pay Payment Processing Certificate:
Section Apple Pay Merchant Identity Certificate :
2.4 Download and send the obtained certificates back to hutko.
The final step in this process is to add the Apple Pay feature to your application. In Xcode, open your project’s settings, select the “Capabilities” tab, and turn on the Apple Pay switch. At this point, you may be prompted to log in to your developer account. Check the box next to the Merchant ID you created earlier and you’re done!
3.2 in integration SDK set merchant_id received during registration in hutko Merchant-Portal in constructor instead of test 1700002
self.api = [PSCloudipspApi apiWithMerchant:1700002 andCloudipspView:self.webView];
github line link:
If you prefer to integrate directly against the Apple Pay API, follow Apple’s instructions.
If you prefer to integrate directly against the Apple Pay API, follow Apple’s instructions.
openssl genrsa -out merchant.key 2048
Apple Pay Merchant Identity Certificate Private Key:
openssl ecparam -out apple_pay.key -name prime256v1 -genkey
openssl req -new -key merchant.key -out merchant.csr
Apple Pay Merchant Identity Certificate Request:
openssl req -new -sha256 -key apple_pay.key -nodes -out apple_pay.csr
openssl pkcs12 -export -out merchant.p12 -inkey merchant.key -in merchant.pem
Example PHP 7.2
<?php $ch = curl_init(); $merchantIdentifier = 'merchant.hutko.{{Your_app_name}}'; // Your Apple Pay Merchant ID from step 1.4 $domainName = 'domain.name'; // The domain name of your website from which the payment is made $displayName = 'description of your service'; $data = [ 'merchantIdentifier' => $merchantIdentifier, 'domainName' => $domainName, 'displayName' => $displayName ]; curl_setopt($ch, CURLOPT_URL, $validationURL); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_CERTINFO, true); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($ch, CURLOPT_SSLCERT, __DIR__ . '/merchant.pem'); curl_setopt($ch, CURLOPT_SSLKEY, __DIR__ . '/merchant.key'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json")); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $res = curl_exec($ch); curl_close($ch); echo json_encode($res);
{ "token": { "paymentData": { "data": "1e3kqjVc...HYJkFFBevkjnAO1jjA9oZsg==", "signature": "MIAGCSq...AfMDB4b77L6sCICoUo9Lr+0mSvGrn5wKYvB19yOYEAuVwTcxickud0LmIAAAAAAAA", "header": { "transactionId": "6fb8a4ea40c8a30c2f8...7b80d9d92d060796018e", "ephemeralPublicKey": "MFkwEwYHKoZIz.....W56yaUW+kMjaDsvaRpVldv17/mDgP4cK8F0gXmvBaJ3SA==", "publicKeyHash": "Yx3yIurI+gR....xH82t/v9uId/8eKM+A=" }, "version": "EC_v1" }, "transactionIdentifier": "6FB8A4EA40C8A30....81EFCC255E7B80D9D92D060796018E", "paymentMethod": { "network": "Visa", "type": "debit", "displayName": "Visa 1111" } } }