Customer onboarding and configuration
When providing a general implementation for a wide selection of merchants, it becomes increasingly important to provide a smooth and easy-to-follow onboarding and configuration experience.
The Management API offers the possibility to automatically configure a Saferpay integration, making the setup faster and more convenient for the merchant. Instead of asking the merchant to manually enter terminal IDs, payment methods and available Saferpay features, the integration can query this information directly, so it may auto-configure itself.
Of course, some basic input from the merchant is required, but keeping it to a controlled minimum reduces the risk of misconfiguration and other mistakes.
This guide will talk you through the best practices and steps needed to achieve this.
1 - Data needed from the merchant & environments
The minimum data that is needed from the merchant is the JSON API User and the API Password. Everything you need can then be derived from that dataset.
For the live account, these details are not provided by Saferpay for security reasons. Instead, the merchant must create them inside the Saferpay Backoffice. Please refer your customer to the respective place by mentioning this detail and linking to this chapter in our documentation.
This way, they are pointed towards the right place and do not have to ask where to get these details.
Furthermore, please note the differences between the Saferpay Live and Test environments. Both environments need a separate configuration on your end, as there is no connection between them, with the merchant having separate test and live accounts respectively.
Besides that, the gateway URL for each environment is also different:
Test-Environment:
https://test.saferpay.com/apiLive-Environment:
https://www.saferpay.com/api
It is important to automatically switch between these URLs, based on the currently chosen environment.
Please keep these differences in mind and offer separate configurations and inputs for both environments, at least for User, Password, and the URLs respectively.
The rest of the configuration (available features and payment methods, settings, etc.) may be cached on your end once the auto-onboarding has been executed for the first time for the respective environment, so it can be automatically switched between them.
Alternatively, you can execute the auto-config steps anew each time the environment is changed. However, doing so may require time, as the application needs time to execute and process the requests.
Caching both is certainly preferred performance-wise, though it requires two sets of configurations and a switch mechanism on your end, making the integration more complex.
2 - Determine the CustomerId
The CustomerId is the main account number of your merchant's account and is needed for basically all requests towards Saferpay, be it this auto-config or actual payments, so we need to determine this value first.
This ID is part of the API user the customer has previously entered into your configuration. It has the following format:
API_<CustomerId>_<Suffix>
So the API User API_123456_09876543 has the CustomerId 123456. Your application needs to extract this ID from the API User, with the underscore (_) being the separator for easy splitting.
3 - Check the available features and verify the input
Once the CustomerId has been determined, we can finally execute the first request to auto-configure the integration.
The Licensing CustomerLicense request lets you query the account's license configuration, giving you an overview of the available Saferpay features. The integration should use this information to determine which functions and settings are available to the merchant.
For example, the Saferpay Fields should only be selectable if the corresponding feature is included in the account's license. The related settings should otherwise be hidden or disabled.
The same applies to Secure Card Data. Card-on-File settings for Customer Initiated Transactions (CIT) and Merchant Initiated Transactions (MIT) should only be selectable if Secure Card Data is activated on the Saferpay contract. Otherwise, these settings should be disabled, for example by displaying them as greyed-out options.
If a feature is required for the integration to operate, a clear error message should identify the missing feature and advise the merchant to contact our sales team or their account manager directly to have it activated.
The merchant can also check the current license and its included features inside the Saferpay Backoffice under Settings > License overview.
Example
Here is an example of how a response may look:
Not all of these features are important for your integration, so here is a rundown of the ones that actually matter to you:
General availability of the Saferpay Payment API. This is probably the most important aspect. Without it, the merchant cannot execute payments via our API in the first place.
Availability of the Hosted Card Entry Form and the Transaction Interface.
The availability of Secure Card Data and Tokenization. Usually used for Recurring Payments.
The availability of the Hosted Card Registration Form and the Standalone Secure Card Data Registration.
The availability of Saferpay Omni-Channel. Enables the transfer of transactions between Saferpay (E-Commerce) and certain Worldline POS solutions.
The availability of the Saferpay Fields via the Transaction Interface and Secure Card Data.
Availability of the Secure PayGate payment link creation via Management API.
Verify the Input
By executing this request successfully, you can also verify the API user, password, and whether the correct environment has been set. Should these be incorrect, Saferpay will respond accordingly:
Should you get this response, you should tell your customer that either the user or the password is incorrect, or that they have entered them into the wrong environment configuration, as test accounts cannot be used on the live environment and vice versa.
4 - Determine the terminal
The terminal is always connected to the CustomerId and can only be used by that account. It contains the information about payment methods, their contracts, available currencies and more.
A merchant may have multiple terminals to cover different use cases. For instance, separate terminals are often used if a merchant is running multiple web shops, franchises, or locations. It may also be interesting for your application to gather information on multiple terminals to offer specific functionality (see the table below).
The Management API is capable of gathering a list of all terminals that are active on this merchant account through the Terminals GetTerminals request. It returns the terminals and their types. You should filter per type if a certain one is needed for your application. The following terminal types may be returned:
ECOM
This terminal is your normal E Commerce terminal, which should be used for normal web-shop applications and recurring payments. So this is used for most of our flows.
SPG
This terminal is very similar to the ECOM terminal, but is specifically used for Secure PayGate applications, like the creation of payment links through the Management API.
MPO
This is a special terminal, that may only be used for Mail Phone Order applications and nothing else.
If only one terminal of the desired type is returned, your application may display and select it automatically. If there are multiple, please present a selection (through a dropdown or similar). If no terminal of the desired type is available, please display a corresponding error message to your customer and point them towards our sales or their account manager in sales.
5 - Retrieve the terminal configuration
Once the terminal(s) has/have been selected, you can go ahead and gather the configuration of the terminal itself by executing the Terminal GetTerminal (mind the missing "s") request.
The response contains the activated payment methods and the available currencies for each payment method. The module can use this information to configure its payment methods and currencies based on the actual terminal configuration.
It also contains URLs for the currently used payment method logos as .svg files. These can be used for display on your website.
6 - Retrieve Payment Page Configuration
The Payment Page configuration is an optional feature that enables the merchant to change certain aspects of the Payment Page, for example a company logo, limited colors and styling, and also the text for the "Buy" button.
By executing the PaymentPageConfig GetConfigurations request, you'll receive a list with all available configurations that you can then submit with the Payment Page Initialize and also (in limited functionality) for the Transaction Interface and Standalone Secure Card Data registration, in order to control certain aspects of the Hosted Forms.
Similar to the terminal selection, the merchant should be able to (de-)select the configuration. If no configuration is returned, simply display an info message that informs the merchant about it and also that it is an optional feature in general.
7 - Set up Saferpay Fields
If the merchant wants to (or has to, depending on your integration) use Saferpay Fields and the corresponding feature is available, the Create Access Token request can be used to generate the required access token during setup.
Access tokens that are no longer needed can be removed using Delete Access Token.
8 - Keeping the configuration up to date
The Saferpay account configuration is nothing that is set in stone. It may change, especially when the customer requests new payment methods or features to be activated. Therefore, it may become necessary to execute the above steps again. However, this should be done with restraint.
What you shouldn't do
You should not execute the auto-config automatically or continue to poll this information, as polling is prohibited. The Management API is intended to be used once for setup and then saved.
Generally speaking, this is not intended to be "overused". Use it if needed and save the information that is returned.
What you should do
Offer a simple reconfigure button to your merchant, so they may reconfigure the account if the need is really there.
You may also detach certain steps, for instance steps 6 and 7. They are separate from the overall account configuration. You do not need to create a new Fields Access Token only because a new payment method or currency has been enabled. Implementing dedicated buttons for these steps is a good way to keep the amount of requests to a minimum and also enables a merchant to specifically reconfigure a certain detail and not the whole account.
Last updated
Was this helpful?
