@traund/sdk v1.1.32
Traund SKD
A javascript library to facilitate the use of the money transfer framework in Traund.
It is intended for usage in browsers.
Installation
The library is UMD compatible, you can download sdk.bundle.js and host it at your site or use a CDN such as Unpkg CDN :
<script src="https://unpkg.com/@traund/sdk/build/sdk.bundle.js"></script>How to use
This library allows you to make money transfers (send or receive) through the Traund platform. To use it you need the integration credentials that are sent to the partner merchant.
Receive payments
You can use this example to start receiving payments using the Traund SDK.
// Initialize client with name of your database and PUBLIC token
const app = new TraundApp();
//Interactions take Id of user and Id of item
app.init(
params :{
token: 'merchant-token',
paymentMethods: ['TRANSFER'],
storeId: ,
sdkMode: 'REGULAR_PAY',
language: 'en',
theme: 'light',
isSandbox: true,
metadata: {
sender: {
email: 'test@customer.com',
firstName: 'Test',
lastName: 'Customer',
identificationCountry: 'PE',
identificationType: 'ID_CARD',
identificationNumber: '44444444',
phonePrefix: '+1',
phoneNumber: '987654321',
},
receiver: {
email: "location@merchant.com",
},
split:[]
},
request_data: {
storeId: 'transaction-calculate-id',
amount: 100,
country: "US",
currency: "USD",
appliedFee: true
},
},
callback,
callbackArgs : [callbackParam1, callbackParam2, callbackParam3]
);You can follow the recommendations in the Traund documentation, the parameters needed to initialize the component are detailed below.
token: Token generated with the authorization credentials you provide to the partner merchant. This is obtained by invoking the authorizate endpoint.paymentMethods: SDK metadata that enable one of two options to make the payment possible. Possible values: 'TRANSFER'|'CARD'sdkMode: usage mode, indicates whether the client will send user's information to traund SDK. Possible values:REGULAR_PAY|DIRECT_PAY. REGULAR_PAY => means a normal Traund's transference, and where the payer metadata is not mandatory and can be filled in the process. DIRECT_PAY => means using traund as a direct payment method. Where the payer's data is mandatory and there is no step during the process where they will be filled out.language: Possible values: en|es.theme: Possible values: light|dark.isSandbox: It's optional. It should only be sent with the value "true", when testing in the sandbox environment.metadata: Data required for SDK invocation.sender => Payer data, required if sdkMode is DIRECT_PAY.
Name Type Detail emailstring Required. firstNamestring Required. lastNamestring Required. identificationCountrystring Required. Country Codes Alpha-2 identificationTypestring Required. Possible values: ID_CARD-ID_BUSINESS-PASSPORT-RESIDENCE_PERMIT identificationNumberstring Required. phonePrefixstring Required. phoneNumberstring Required. receiver => Receiver data, required if sdkMode is DIRECT_PAY.
Name Type Detail emailstring Required. request_data => Required transaction data.
Name Type Detail storeIdstring Optional. Identifier of the calculated amount of the transfer to be made. This is obtained by invoking the calculation endpoint. amountnumber Required. countrystring Required. Country Code Alpha-2. currencystring Required. Currency Code appliedFeeboolean required if paymentMethods include CARD
Callback
The use of a callback function is required. This must receive as first parameter a "response" object, here the result of the operation performed through the SDK will be returned.
Additional parameters can be sent through the array "callbackArgs", which will be sent to the callback with the object "response".
function customCallback(response, callbackParam1) {
console.log(response, param);
}
var callbackParam1 = "Thanks for using Traund SDK";
app.init(params , customCallback, callbackArgs : [callbackParam1, callbackParam2, callbackParam3]);Response Object
It is the first parameter defined in the "callback" function where the result of the operation is sent.
For example:
//Interactions take Id of user and Id of item
{
"success": true,
"message": "Transaction successfully updated",
"data": {
"transaction": {
"id": "63186a7ec8437ae8c46658a7",
"statusCode": 200,
"statusName": "Deposited",
"currency": "USD",
"amount": 100.00,
"createdAt": "2022-09-07T09:55:10.112Z"
},
"user": {
"email": "jesus@traund.com",
"status": "registered",
"kyc": {
"required": true,
"status": "unregistered"
}
}
}
}Response description:
success: Operation result flag.message: Operation result description.data: Result object.transaction => Transaction data.
Name Type Detail idstring Traund ID statusCodenumber Status code statusNamestring Status description currencystring Receiver currency amountnumber Receiver amount createdAtdate Created date user => User data.
Name Type Detail emailstring Traund ID statusstring User status kyc.requiredboolean required compliance validation flag. kyc.statusstring Compliance Status. KYC Validation
All persons performing transactions using the Traund payment button through the SDK must undergo a mandatory identity validation process.
SDK response will return the result of this validation in the
data.user.kyc.requiredfield, indicating whether the person is required to undergo the process.It is the responsibility of each customer to ensure that the person making the payment has undergone a KYC process; if this process cannot be validated, the transaction will not be completed.
In addition, it is possible to use our compliance services to meet the identity validation requirement, please contact your dedicated sales advisor for more information.
Integration Example (In construction)
1. Authorize SDK with your credentials.
2. Calculate amount to transfer.
3. Create TraundApp instance.
3. Evaluate callback response.
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago