Installation
dotnet CLI
Install the latest SDK using dotnet CLI:
dotnet add package PingPayment.KYC
NuGet.exe
Install the latest SDK using NuGet.exe:
nuget install PingPayment.KYC
Visual Studio
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "PingPayments.KYC".
- Click on the PingPayments.KYC package, select the appropriate version in the right-tab and click Install.
Client
The client exposes all enpoints and It's operations that let you create and interact with Ping Payments KYC API through your Ping Payments account. Ping Payment KYC Client uses the Http Client for sending and receiving HTTP responses.
Ping Payment KYC Client
The using
directive allows you to use types defined in a namespace without specifying the fully qualified namespace of that type. Add the following using directive from the PingPayments.KYC
namespace:
using PingPayments.KYC;
Initializing the client with an appropriate environment.
- For testing use the Sandbox environment,
PingEnvironments.KYC.SandboxUri
. - For Production use
PingEnvironments.KYC.ProductionUri
.
var httpClient = new HttpClient().ConfigurePingPaymentsClient(PingEnvironments.KYC.SandboxUri, tenantId);
var api = new PingKycApiClient(httpClient);
Or use Dependency injection
services.AddHttpClient<IPingKycApiClient, PingKycApiClient>(client =>
{
client.ConfigurePingPaymentsClient(PingEnvironments.KYC.SandboxUri, tenantId);
});
Session (Endpoint)
The Session enpoint exposes one method dedicated to dealing with KYC sessions.
Method
Initiate Session
Initiate a new verification session.
Usage:
-
Create a Ping KYC Client.
-
Call the
Initiate()
method with aIntiateSessionRequest
.await api.Session.V1.Initiate(initiateSessionRequest);
Parameters
Parameter | Type | Requierd | Description |
---|---|---|---|
IntiateSessionRequest | InitiateSessionRequest | Yes | Request body required to initiate a new verification session. |
Returns
Object is being returned with two fields: validation_url
and verification_id
. If there is a problem with the request an error response will be returned.
Example Usage
//Create a new InitiateSessionRequest
var initiateSessionRequest = new InitiateSessionRequest("[email protected]", "0706542314", "199409082333")
//Make call to API
var response = await api.Session.V1.Initiate(initiateSessionRequest);
Response
201 CREATED
{
"validation_url": Uri,
"verification_id": "string"
}
Merchants (Endpoint)
The Merchant endpoint exposes three methods dedicated to dealing with KYC associated with merchants.
Methods
Get Merchant
Get merchants based on the GetKycRequest
.
Usage
- Create a Ping KYC Client.
- Call the
Get()
method with aGetKycRequest
.await api.Merchant.V1.Get(getKycRequest);
- Handle response.
Parameter | Type | Requierd | Description |
---|---|---|---|
GetKycRequest | GetKycRequest | Yes | Request body required to get merchant |
Returns
A list of objects is being returned. Each object in the list contains information about a merchant. If there is a problem with the request an error response will be returned.
Example Usage
//Create a new GetKycRequest
var getKycRequest = new GetKycRequest
{
Page = 1,
PageSize = 10,
};
//Make call to API
var response = await api.Merchant.V1.Get(getKycRequest);
Response
200 OK
[
{
"addresses": [],
"bank_account": {
"bic": "NDEASESS",
"iban": "SE7280000810340009783242"
},
"country": "se",
"email": "[email protected]",
"id": "021d404f-0a3f-46c1-8189-6fc27151b1f2",
"metadata": {},
"name": "Svante Larsson",
"person_data": {
"birthdate": "1985-12-24",
"firstname": "Svante",
"gender": "Male",
"identity": "198002015841",
"lastname": "Larsson"
},
"phone": "0705555555",
"type": "person"
}
]
Verify merchant
Send verification data for merchant.
Usage
- Create a Ping KYC Client.
- Call the
Verification()
method with aKycVerificationRequest
.await api.Merchant.V1.Verification(kycVerificationRequest);
- Handle response.
Parameters
Parameter | Type | Requierd | Description |
---|---|---|---|
KycVerificationRequest | KycVerificationRequest | Yes | Request body required to make a verification. |
Returns
Empty response. If there is a problem with the request an error response will be returned.
Example Usage
var kycVerificationRequest = new KycVerificationRequest
(
bankAccount,
"SE",
"[email protected]",
merchantId,
"Svante",
"0705555555",
LegalEntityTypeEnum.person,
personData: personData
);
var response = await api.Merchant.V1.Verification(kycVerificationRequest);
Response
204 No content
{}
Merchant AIS
Account Information Service for Merchants.
Usage
- Create a Ping KYC Client.
- Call the
AIS()
method with aaisMerchantRequest
.await api.Merchant.V1.AIS(aisMerchantRequest);
- Handle response.
Parameters
Parameter | Type | Requierd | Description |
---|---|---|---|
aisMerchantRequest | AisMerchantRequest | Yes | Request body required to perform a verification. |
Returns
Object is being returned with two fields: If the response is 200
ais_url
and verification_id
is returned, If the response is 201
merchant_id
and message
is returned. If there is a problem with the request an error response will be returned.
Example Usage
var request = new AisMerchantRequest
(
"SE",
merchantId
distributionObj,
"[email protected]",
"0701231212",
"199611015676",
redirects,
style
);
var response = await api.Merchant.V1.AIS(request);
Response
200 ok
{
"ais_url": "www.somesite.se",
"verification_id": "id"
}
201 Created
{
"merchant_id": "88b5dae6-c691-49c4-86f8-8d51b0b2bbc",
"message": "The entity was already registered, created new merchant"
}
Updated 3 months ago