ApplePay
Paysafe checkout allows customers to make payments using mobile-based payment methods such as Apple Pay which rely on card payments through the Paysafe Payments API.
Advantages
- Complies with PCI SAQ-A
- Simple and Quick integration
Supported Transaction Type
- Payments
Set-up Apple Pay in Paysafe Checkout
- Set up your merchant account with Paysafe Business Portal. Contact our integration team to get access to it.
- To obtain the Public API key from the Business Portal see here.
- Register for Apple Merchant ID.
- To configure the Apple Pay Certificates in the business portal see here.
Contact your business relationship manager or reach out to customersupport@paysafe.com (for North American merchants) or uk.customerservice@paysafe.com (for European/UK existing merchants) for Business Portal credentials.
Example Payment Form
Here is a sample HTML payment form that creates Apple Pay as a payment method in Paysafe Checkout:
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
<script src="https://hosted.paysafe.com/checkout/v2/paysafe.checkout.min.js"></script>
</head>
<body style = "width :'100%'">
<button onclick="checkout()"> Pay $25 </button>
</body>
<script>
function checkout() {
paysafe.checkout.setup("c3V0LTM0ODg2MDpCLXFhMi0wLTVkM2VjYjMwLTEtMzAyYzAyMTQyYTM3NjgxMmE2YzJhYzRlNmQxMjI4NTYwNGMwNDAwNGU2NWI1YzI4MDIxNDU1N2EyNGFiNTcxZTJhOWU2MDVlNWQzMjk3MjZjMmIzZWNjNjJkNWY=", {
"currency": "USD",
"amount": 2500,
"locale": "en_US",
"amountoptions": [500, 10000, 60000],
"simulator": "EXTERNAL",
"merchantRefNum": "193767720k213012",
"canEditAmount": true,
"billingAddress": {
"street": "222333 Peachtree Place",
"city": "Atlanta",
"zip": "30318",
"country": "US",
"state": "GA"
},
"environment": "TEST",
"merchantDescriptor": {
"dynamicDescriptor": "Paysafe test",
"phone": "9505610677"
},
"customer": {
"firstName": "John",
"lastName": "Smith",
"email": "paysafe.user@paysafe.com",
"phone": "3069443197",
"dateOfBirth": {
day: 28,
month: 2,
year: 1975
}
},
"paymentMethodDetails": {
applePay: {
//accountId: "1001456390", //optional , needed for multiple ApplePay accountId.
label: "Pay With Apple",
requestShippingAddress: false,
requestBillingAddress: false,
type: 'buy',
supportedCountries: ['US', 'CA', 'GB'],
color: 'white-outline'
}
}
},
function(instance, error, result) {
if (result && result.paymentHandleToken) {
console.log(result);
// make AJAX call to Payments API
// alert(result.paymentHandleToken + " - token to be used to make server to server call to Payments API");
instance.showSuccessScreen("Your goods are now purchased. Expect them to be delivered in next 5 business days.");
} else {
console.error(error);
// Handle the error
}
},
function(stage, expired) {
switch (stage) {
case "BeforePayment": // Handle the scenario
break;
case "DuringPayment": // Handle the scenario
break;
case "AfterPayment": // Handle the scenario
break;
default: // Handle the scenario
}
});
}
</script>
</html>
Set up function and object
Parameter | Required | Type | Description |
---|---|---|---|
paymentMethodDetails | true | object | Required, if the merchant is offering this payment method. |
applePay | true | object | Required, if the merchant is offering this payment method. |
accountid | true (conditional) | string | Required, if there are multiple apple pay accounts with same currency. |
label | true | string | Displayed on payment sheet |
requestShippingAddress | false | bool | Default is false. If true, Apple Pay will require shipping address. |
requestBillingAddress | false | bool | Default is false. If true, Apple pay will require billing address. |
type | false | string | ("plain", "buy", "addMoney", "book", "checkout", "continue", "contribute", "donate", "instore", "order", "reload", "rent", "setup", "subscribe", "support", "tip", "topup") Default: pay Click here to view Apple Guidelines. If no or wrong value is provided then checkout will create buttons with default values. |
color | false | string | (white, black, white-outline) Default: white-outline Click here to view Apple Guidelines. If no or wrong value is provided then checkout will create buttons with default values. |
supportedCountries | false | two-letter ISO 3166 country code array | Limits payments to cards from specific countries. |
Click here to review the complete list of parameters definition.