To use Apple Pay as a payment method, you must create a Merchant ID and the corresponding certificate. And upload the certificate to the portal. In this section we will show you how to create a Merchent ID and how to get the certificate. If you do not want to use Apple pay you can ignore this section.
- open xCode and click on your project and go to tab
Signing & Capabilities
- on this tab click to
+ Capability
and writeApple Pay
into search bar - after confirming the dialogue a new section will be added
- Click on plus icon and create you new Merchant ID.
- Once your Merchant ID is created, it will be sent to the certificate on developer.apple.com. Open your
identifiers
you can use filterMerchant IDs
in right top corner. - Click on the Merchant ID you created. At this page you need to create
Apple Pay Payment Processing Certificate
in this section click onCreate Certificate
- You will be ask for additional information. When you answer you can click on
Continue
button - Now you have to create and upload
Certificate Signing Request
. OpenKeychain Access
on you Mac and go to top bar menuKeychain Access => Certificate Assistant => Request a Certificate From a Certificate Authority...
- Now you have to fill basic information about certificate request and select
Saved to disk
and also checkLet me specify key pair information
and click onContinue
- In next window you have to specify type of certificate request you have to select
Algorithm: ECC
andKey Size: 256 bits
then you can click onContinue
and save your certificate request to disk - Now you have to upload saved certificate request to apple developer page and click on
Continue
12.Your certificate was successfully created. You can download it. Next step will be uploading this certification to Portal.
- Open KeyChain => Login => Keys
- Right click at your private key and select option
Export YOUR CERTIFICATE NAME
- You have to save this private key as
Personal Information Exchange (.p12)
format. - After saving this certificate you will be asked to create a password. Keep the password field empty! And continue by pressing
OK
- Next step is just confirm action with your personal password and after conformation you will get
.p12
certificate. This certificate has to be uploaded to Portal
- Open Portal => Space => Select Relevant Space => Settings
- On the top menu select Payment => ApplePay
- Make sure ApplePay is enabled
- Click Payment Processing Certificate
- Fill in the Merchant Identifier and attach Private Key File and Payment Processing Certificate File in the following window:
The final step is setting up the Merchant ID in SDK configuration. To do so, please call the configureApplePay(merchantId: "merchant.your.id")
method with the relevant Merchant ID. This method can be called for example after SDK initialization.
paymentSdk = WalleePaymentSdk(eventObserver: self)
guard let paymentSdk = paymentSdk else { return }
paymentSdk.configureApplePay(merchantId: "merchant.your.id")