Introduction
SDK composition
The .NET SDK consists of the following elements:
- a web application example using the SDK;
- a functions library that allows you to use the functions of the Payline API;
- an SDK configuration file;
- an installation guide for the integration SDK;
- the WSDL file describing the Web Services offered by Payline.
Download the SDK (4.8.1) of the Payline API version 26 of release 4.64.1:
- https://www.nuget.org/packages/Monext.Payline.DotNetSDK/
- https://github.com/PaylineByMonext/payline-dot-net-sdk
Structure and Functions
An example of a web application
Each Payline web service is available in the form of two files:
- an ASPX.CS file containing the presentation form;
- an ASPX file which retrieves the data transmitted by the user via the form. The C # code makes the call to the desired Web Service.
For example, the “doWebPayment” functionality, which allows a Web payment to be made via the SDK, results in the presence of the following two files:
- doWebPaymentForm.aspx This file simulates the summary page of your customer's order. It constitutes step 0 in the web payment process. You can change the Amount , Currency, and OrderRef values to make test payments.
- doWebPayment.aspx.cs This file contains the ASP code which retrieves the information transmitted by the HTML form and uses the library to initiate a web payment request.
A library
The SDKPayline class , corresponding to the SDKPayline.dll file stored in the Bin directory of the SDK, offers a function corresponding to each web service, bearing the same name as the latter (doWebPayment, doAuthorization,…).
The passage of parameters between your store and these functions is explained through the example pages contained in the SDK.
A 3D Secure directory
The 3DSecure directory in the SDK contains the script that processes the callback during a 3D Secure transaction in direct mode. This is the link to this file that must be put in the configuration file at the TERM_URL key. You will find more details in the 3D Secure integration document in direct mode.
SDK configuration
Once the SDK is unzipped on your server, you must associate values with the configuration parameters declared in the Resource.resx file .
MERCHANT_ID: the identifier of your merchant account.
ACCESS_KEY: the access key associated with your merchant account.
PROXY_HOST: the URL of your Internet proxy.
PROXY_PORT: the communication port of your Internet proxy.
PROXY_LOGIN: the user identifier required by your proxy Internet.
PROXY_PASSWORD: the user password required by your Internet proxy.
PROD: indicator that allows you to easily switch from the certification environment to production.
PAYMENT_CURRENCY: the ISO code of the currency to use by default for the payment.
ORDER_CURRENCY payment the ISO code of the currency to use by default for the order.
SECURITY_MODE the code of the security mode to use by default.
LANGUAGE_CODE: the ISO code of the language to display by default.
PAYMENT_ACTION: the code of the payment method to be used by default.
PAYMENT_MODE: the payment method to be used by default.
CANCEL_URL: the cancellation URL used when the payment was refused or when your customer canceled the payment.
NOTIFICATION_URL: the notification URL used when Payline notifies you of a payment done.
RETURN_URL: the return URL used when payment was accepted.
CUSTOM_PAYMENT_TEMPLATE_URL:the URL of the dynamic template to be applied to the payment web pages.
CUSTOM_PAYMENT_PAGE_CODE: the code for customizing the Payline payment pages to be used by default.
CONTRACT_NUMBER: the contract number that identifies your point of sale and your default payment method.
CONTRACT_NUMBER_LIST: the list of contract numbers to display if you have more than one. Otherwise your unique contract number.
SECOND_CONTRACT_NUMBER_LIST: the list of contract numbers to display when the first payment attempt is unsuccessful.
TERM_URL: Callback URL for the return of the ACS during 3D Secure transactions in direct mode.
SDK compatibility
The .NET SDK is tested with the following environment:
The .NET 2.0 Payline SDK is compatible with the following environment:
- IIS 5.1, .NET 4 with Windows XP Professional SP3 system.
- IIS 7.5, .NET 4 with Windows 7 SP1 system.
- IIS 7.5, .NET 4 with Windows Server 2008 R2 system.
To test the sample SDK application
Getting started
Create a site or a virtual directory under IIS.
Unzip the .NET 2.2 SDK
Select the SDK directory then connect with a local administrator account.
Test cards
Expiration dates: a valid date to come example 12/2018
Cryptogram: a number in 3 positions. Example 123
The 3D Secure password is secret3
Simple test cards | 3D Secure test cards |
---|---|
4970101122334406 | 4970101122334455 |