To start accepting Titres-Restaurant payments, you must:
Get an official authorization from the Mealvoucher National Comission. From them, you receive a Carte de domiciliation CONECS with your CONECS MID.
For each meal voucher that you want to accept, contact the meal voucher issuer (Sodexo, Up Déjeuner, or Natixis) for a contract.
Contact our Support Team to activate the meal voucher payment method, and let us know:
SIRET (Your business registration ID)
The Conecs MID from your Carte de domiciliation CONECS.
API reference
You don't need to send additional fields for Titres-Restaurant. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:
Add the following event to your payment method configuration object:
Event name
Description
onOrderCreated(orderStatus)
Called when the balance on the card is less than the transaction amount. Returns an orderStatus object that includes the remaining amount to be paid. Use your existing instance of AdyenCheckout to create components for payment methods that the shopper can use to pay the remaining amount.
The following example shows how to configure the Titres-Restaurant Component to allow the shopper to pay the remaining amount using a credit or debit card.
Component configuration
const mealVoucherConfiguration = {
onOrderCreated: function (orderStatus) {
// Get the remaining amount to be paid from orderStatus.
console.log(orderStatus.remainingAmount);
// Use your existing instance of AdyenCheckout to create payment methods components
// The shopper can use these payment methods to pay the remaining amount
const cardComponent = checkout.create('card').mount('#card-container');
// Add other payment method components that you want to show to the shopper
}
};
Use the create method of your AdyenCheckout instance, in this case checkout, to create an instance of the Component. Pass the configuration object that you created above:
Mount the Component only after checking that Titres-Restaurant is available to the shopper:
mealVoucherComponent
.isAvailable()
.then(() => {
mealVoucherComponent.mount("#mealVoucher_FR_sodexo-container");
})
.catch(e => {
//Titres-Restaurant is not available
});
When using your own Pay button, you must call the balanceCheck() method from your button implementation. If the balance on the card is enough to pay the full payment amount, call the submit() method to make the payment.
Method name
Description
balanceCheck()
Checks whether the balance on the card is enough to pay the full payment amount.
submit()
Makes a payment after the onRequiringConfirmation event has been called.
To know if the balance on the card is enough to pay the full payment amount, add the following events to the payment method configuration object:
Event name
Description
onOrderCreated(orderStatus)
Called when the balance on the card is less than the transaction amount. Returns an orderStatus object that includes the remaining amount to be paid. Use your existing instance of AdyenCheckout to create components for payment methods that the shopper can use to pay the remaining amount.
onRequiringConfirmation
Called when the balance on the card is enough to pay the full payment amount. The shopper must then confirm that they want to make the payment with the card. Use the submit() method to make the payment.
The following example shows how to configure the Titres-Restaurant Component to allow the shopper to pay the remaining amount using a credit or debit card.
Gift card configuration
const mealVoucherConfiguration = {
onOrderCreated: function (orderStatus) {
// Get the remaining amount to be paid from orderStatus.
console.log(orderStatus.remainingAmount);
// Use your existing instance of AdyenCheckout to create payment methods components
// The shopper can use these payment methods to pay the remaining amount
const cardComponent = checkout.create('card').mount('#card-container');
// Add other payment method components that you want to show to the shopper
}
onRequiringConfirmation: function() {
document.querySelector('#button-to-confirm')
.addEventListener('click', () => window.mealVoucher_FR_sodexo.submit());
}
};
Use the create method of your AdyenCheckout instance, in this case checkout, to create the Component. Pass the configuration object if you created one:
To configure the Component to create and cancel orders, add the following events to your Titres-Restaurant configuration object:
Event name
Description
onOrderRequest(resolve, reject, data)
Called when the balance on the crad is less than the transaction amount. Make an /orders request with the amount of the total transaction amount.
onOrderCancel(order)
Called when the shopper cancels the transaction. Make an orders/cancel request.
The following example shows how to configure the Titres-Restaurant Component:
Gift card configuration
const mealVoucherConfiguration = {
onBalanceCheck: function (resolve, reject, data) {
// Make a POST /paymentMethods/balance request
resolve(BalanceResponse);
}
onOrderRequest: function (resolve, reject, data) {
// Make a POST /orders request
// Create an order for the total transaction amount
resolve(OrderResponse);
}
onOrderCancel: function(Order) {
// Make a POST /orders/cancel request
// Call the update function and pass the payment methods response to update the instance of checkout
checkout.update(paymentMethodsResponse, amount);
}
};
Use the create method of your AdyenCheckout instance, in this case checkout, to create an instance of the Component. Pass the configuration object that you created above:
Mount the Component only after checking that Titres-Restaurant is available to the shopper:
mealVoucherComponent
.isAvailable()
.then(() => {
mealVoucherComponent.mount("#mealVoucher_FR_sodexo-container");
})
.catch(e => {
//Titres-Restaurant is not available
});
(Optional) Making partial payments
When balance of the shopper's gift card is less than the payment amount, no payment is made. Instead, the onOrderRequest event creates an order for the full payment amount. After the order is created, you can start making partial payments:
The response to the onOrderRequest event includes the following fields that you need for payment:
Field
Description
pspReference
The unique reference for the order.
orderData
The details needed to make payments for the order.