visit
``
ssl_stapling on;
ssl_stapling_verify on;
ssl_protocols TLSv1.2;
#ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';
ssl_prefer_server_ciphers on;
#ssl_dhparam /etc/nginx/dhparams.pem;
ssl_dhparam /home/forge/dhparam/dhparam.pem;
<div class="item" v-if="(window.ApplePaySession && window.ApplePaySession.canMakePayments())">
<input class="apple-pay" type="submit" @click="sendCreateOrderRequest" value="" style="-webkit-appearance: -apple-pay-button; width: 100%;height: 40px;
-apple-pay-button-type: plain;
-apple-pay-button-style: black;"
>
</div>
5. Now let's create a
certSigninRequest.certSigninRequest
:16. If you missed step 5 go back and take a look at how to create a certSigninRequest.certSigninRequest. If you haven't created one yet, now is the time using encryption RSA:2048.
17. Download your previously created certSigninRequest.certSigninRequest and then download merchant_id.cer.
18. Import received merchant_id.cer in Keychain (it required to export file in .p12).19. In category Certificates in Keychain, you need to export the certificate using format .p12.20. Generate merchantIdentityCert from the received file using the command below:openssl pkcs12 -in your_cer_name.p12 -out you_key_cert_name.pem -clcerts.21. Enter the password that was entered during export merchant_id.cer in .p12.22. Enter PEM pass phrase - this will be the key to the generated merchantIdentityCert.23. Put the generated
merchantIdentityCert
in the project’s folder.24. Use
merchantIdentityCert
in the body of the request for validation Apple Pay Session.25. Example of the request. $response = $client->post($request->appleValidationUrl, [
'body' => json_encode([
'merchantIdentifier' => $request->appleMerchantId,
'displayName' => $request->displayName,
'initiative' => 'web',
'initiativeContext' => 'name of your api'
]),
'curl' => array(
CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2,
CURLOPT_SSLCERT => public_path(path_to_merchant_identity_cert.pem),
CURLOPT_SSLKEYPASSWD =>’your_pem_passphrase’,
CURLOPT_SSLKEY => public_path(path_to_merchant_identity_cert.pem'),
),
]);
appleValidationUrl
- it is url that is obtained when calling onvalidatemerchantevent
appleMerchantId
- it is identificator of Merchant in Apple PaydisplayName
- it is the name of seller.sendCreateOrderRequest: async function () {
if (!window.PaymentRequest)
return;
const applePayMethod = {
supportedMethods: ["//apple.com/apple-pay"],
data: {
version: 3,
merchantIdentifier: "your_merchant_identifier",
merchantCapabilities: ["supports3DS", "supportsCredit", "supportsDebit"],
supportedNetworks: ["mastercard", "visa"],
countryCode: "put there your country code",
currencyCode: "put there code of currency you will use",
domainName: "your_domain_name"
},
};
const paymentDetails = {
total: {
label: this.product.name,
type: "final",
amount: {value: this.price, currency: "currency"},
},
};
const request = new PaymentRequest([applePayMethod], paymentDetails);
request.onmerchantvalidation = function(event) {
console.log(event);
var data = JSON.stringify(
{
appleValidationUrl: event.validationURL,
appleMerchantId:"your_merchant_identifier",
displayName: "your_merchant_name"
});
fetch("url_to_validate_merchant", {
body: data,
headers: {'content-type': 'application/json'},
method: "POST",
}).then(response => {
event.complete(response.json())
});
};
const response = await request.show();
response.complete('success');
},
}
(Disclosure: The Author is the Owner of SPDLoad)