Native iOS app with payment using Dintero.
See Apple Pay native payment documentation.
The application takes an existing session for in-app payments.
This example app shows how to:
- Get session payment details given a Dintero payment session ID
- Get session payment operations
- Show native Apple Pay button
- Open Apple Pay payment view
- Submit payment data to the Dintero PSP
- Complete session payment
- Show payment result
Sample session request body, not that the return_url
must
match the app url namespace, and that initial_recipient=merchant
must be set if the link in the session payment response should
be followed.
{
"url": {
"return_url": "dinterodemo://redirect?initial_recipient=merchant",
"callback_url": "https://<your-backend-callback-handler>"
},
"order": {
"amount": 20100,
"currency": "NOK",
"merchant_reference": "<unique-reference>",
"items": [
{
"id": "<item-id>",
"line_id": "<unique-id-per-line>",
"description": "Item to be paid for",
"amount": 20100,
"quantity": 1,
"vat_amount": 4020,
"vat": 25
}
]
},
"configuration": {
"channel": "in_app",
"dintero_psp": {
"applepay": {
"enabled": true
}
}
},
"expires_at": "<ISO-timestamp>"
}
- Create a merchantID in your apple developer account
- Open the merchantID details page
- Obtain a .csr file (certifiacate request) from dintero by email to [email protected]
- Press the "Create Certificate" button
- Upload the .csr file received by dintero
- Download the certificate
- Send the certificate to [email protected] so we can verify your payments
- Open the certificate and ensure that it is added to the Keychain Access on your delveoper machine
- In xcode app project settings, press the Signing and Capablities tab
- Press the "+ Capability" button and select Apple Pay
- Select the merchantID configured in step 1