Create Payment
This articles walks you through a Create Payment example. At the end of this section you should have created a payment and received a response.
Before you start
Before you start make sure you have contacted our Unified Service support and have received a ClientId
and a ClientSecret
for the channel you want to use and generated your access token.
Depending on what channel you want to use, there might be additional requirements. Please check available channels to learn more. In our example we assume you are using the Netaxept service as a source: you would need to have a Netaxept admin account as well.
Unified Services uses several APIs.
There are two different environments for each of these APIs: the test environment and the live environment.
In the following examples we will always refer to the test environment. Please find the base url's for both, test and live environment in the API reference.
To process payments with Unified Commerce you use the PaymentService API:
PaymentService API base url (test environment):
sandbox.unifiedapi.nets.eu/api/v1/payments
Please find the production base url in our API reference.
Overview
When your customers confirm their order (in your webshop, on terminal), the Create a payment call must be triggered.
Please make sure to include the access token as a header parameter into all your calls to Unified Services.
The purpose of the Create a payment call is to send all the data needed to initiate a payment to Unified Services. That includes:
- the payment type - for Netaxept that defines, whether the PayPage is hosted by you OR by Nets OR whether it is going to be a MOTO (Mail Order Telephone Order) transaction.
The specifcs of the Create Payment call's request body depend on the paymentType
's value.
-
the paymentMethodDetails - one time payment OR recurring payment, for example
-
the PayPage attributes - this value allows you to customize the Nets hosted PayPage (relevant if payment type indicates a Nets hosted PayPage)
and others.
We will explain each of these parameters further below.
Create Payment Flow
This section illustrates the Create Payment Flow.
-
First, your users clicks something like "PayNow" once they have filled their cart on your webshop.
-
That click triggers the Create Payment call.
-
Unified Services sends the Response, after receiving the
paymentId
from the channel. -
Customers are sent to the PayPage. Here they choose the payment method (out of the list of available payment methods that has been sent with the
paymentMethodActionInfoList
array as part of the Create Payment call'spayPageConfiguration
object). -
After succesfull 3rd party authorization, the customer is sent to the url as defined by you with the Create Payment call's redirectUrls object.
PayPage
The PayPage is the Page where your consumers choose their payment method and enter their payment details.
Depending on the channel you use, there are certain choices you have to make and you should define the corresponding Create payment call's parameters accordingly.
type
The allowed values for the type
parameter depend on the channel. Please check the specifics in the relevant channel section.
Please also note that for Netaxept, depending on the type
's value, the Create Payment's request body changes.
Since in our example we are using Netaxept as a channel, the possible values for the type
parameter would be:
"type":"MerchantHostedEcom"
- the PayPage is going to be hosted by you."type":"NetsHostedEcom"
- the PayPage is going to be hosted by Nets.
An additional scenario would be to choose MOTO
(Mobile Order Telephone Order) as a value: in that case there wouldn't be a PayPage at all.
In our example, the type
's value must be NetsHostedEcom
: Your customer is going to be directed to a PayPage hosted by Nets.
Customize the PayPage
Even though the PayPage in our example is going to be hosted by the channel (Nets) there are channel-specific ways to customize the PayPage.
Please find the details in the relevant channel section - in our case: Netaxept.
PayPage Configuration
In addition to customizing the PayPage, you can configure the Nets hosted PayPage using the create Payment's payPageConfiguration
object.
The payPageConfiguration
object is only relevant, if type = NetsHostedEcom
.
With the pagePageConfiguration
object you define your PayPage's:
Language
Currently, the Nets hosted PayPage supports 16 languages.
PayPage Type
There are three different page types to choose from: Multipage
, Singlepage
, Custom
. Learn more about PayPage types here.
In our example we choose Multipage
.
Payment Methods
The PaymentMethodActionInfo
object contains the PaymentMethod
array. You can use that array to define what PaymentMethods are going to be displayed on the PayPage, and in which order.
With the PaymentMethodActionInfo
object you can also determine additional payment method attributes such as fee, cardType, cardOrigin and so on. Please check our API reference for further details.
For Netaxept as a source, the available payment methods are the ones you have enabled in your Netaxept admin account. The list of payment methods you want to display, can be a subset of these enabled payment methods. If the PaymentMethodActionInfo
object is omitted from the Create payment
call's request body, all possible payment methods will be displayed.
Redirect Url
The redirect url set is the url, where your customer is going to be directed to; after they have passed the PayPage.
Whether or not the payment was successful can be seen on that returned url.
In any case, you might want to send the Get details of a payment call to get all the details of the payment and to act accordingly.
Order and Basket
Order and Basket
The createPayment call also contains the order related information such as paymentNumber
, checkoutText
, amount
and so on.
basket
is an array, that contains the item information such as itemNumber
, title
, price
and others.
Please find a complete list of related fields in our API reference.
Customer
Customer
In addition to the order information, the Create Payment call contains the relevant customer's data such as customerNumber
, address
and so on.
Strong Customer Authentication
There are several options for Strong Customer Authentication. You define them using the Create Payment call ScaExemption
object.
ScaExemption object
ScaExemption": { "type": "object", "properties": { "type": {
The ScaExemption object contains the type
key. That key allows three values:
-
Delegated: Delegated authentication. Please contact us to enable this for your MerchantID[?]
-
Low Value: Use this parameter to request an exemption from Strong Customer Authentication (SCA) without the need to perform 3D Secure authentication. Note that exemptions are not allowed to be used in connection with initial transactions when card details are saved for subsequent transactions. Low value payment. Do not add this parameter if the amount is higher than 30 EUR.
-
Force3ds: the customer must be fully authenticated by 3D Secure or the equivalent authentication method to be able to complete the transaction.
When you make an online purchase, 3D Secure authentication adds an extra layer of security to the payment process. Instead of just entering your credit card details, you will be redirected to a secure website where you will be asked to enter a password or a one-time code that is sent to your mobile phone. This additional step helps to ensure that the person making the purchase is the legitimate cardholder and not someone else who may have stolen the card details.
This parameter is optional. The default value is none
.
Request Body - Example
Below is an example of a create Payment call's request body.
Example Create Payment call - (type:NetsHostedEcom) - request body
{ "type": "NetsHostedEcom", "paymentNumber": "string", "checkoutText": "string",
The example above contains the processing
key. It is set to None
, since this call is sent to create a payment. Alternative values for that key would be Authorize
, and Sale
. All of these values will be explained in the Process Payments section section of this guide.