npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

payture-official

v0.0.10

Published

Official Payture API for NodeJS

Downloads

21

Readme

NodeJS-Payture-official

This is Offical Payture API for NodeJS. To get started you will need a Merchant account, please contact our support to get one. Here you can explore how to use our API functions! GO!

Install

Simple to install:

npm install payture-official

And include to your project:

var payture = require('payture-official');

Payture API tutorial

You can use one or all of follows API:

General information

Callback function

Every API function received callback function as second parameter. You need to provide callback for taking required action after receiving a response from the server. The callback accepts 4 parameters:

var callbackFunc = function(error, response, body, responseObject){
    // do some work with received arguments....
};
  • error - if no one error occurs when handing request the value of this parameter will be null, otherwise - in case of error - the value is the error;
  • response - the raw response from the external server;
  • body - body of the received response;
  • responseObject - this is body of the response as js object;

API Initialization

For create instanse of required API you need provide the name of Host and params of your Merchant account (Key and Password).

HOST

Pass the 'https://sandbox.payture.com' for test as the name of Host (first parameter).

Merchant

Params of Merchant account provide as the second parameter for constructor function in simple object, like: { Key : 'YourMerchantAccount', Password : 'YourPassword' };

Please note, that { Key : 'YourMerchantAccount', Password : 'YourPassword' } - fake account, our support help you to get one! Examples you can see below.

Payture API

For use this you need create instanse of PaytureAPI object. Example:

var api = new payture.Api('https://sandbox.payture.com', { Key : 'YourMerchantAccount', Password : 'YourPassword' });

Please note, that { Key : 'YourMerchantAccount', Password : 'YourPassword' } - fake account, our support help you to get one!

API Functions:

All functions taking 2 parameters: first - required for request data as js object, second - callback function that you need specify. The functions list and examples of usage below. Let's go to explore!

pay

var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    PAN : '4111111111111112',
    EMonth : 12,
    EYear : 20,
    CardHolder : 'Vasya Petrov',
    SecureCode : 123,
    CustomerKey : 'testCustomer',
    CustomFields : {},
};
api.pay(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | PAN | Card's number. | | EMonth | The expiry month of card. | | EYear | The expiry year of card. | | CardHolder | Card's holder name. | | SecureCode | CVC2/CVV2. | | CustomerKey | Customer identifier in Payture AntiFraud system. | | CustomFields | Addition fields for processing (especially for AntiFraud system). |

block

The data and description for params as the same as for pay function.

api.block(data, callbackFunc);

charge

var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000
};
api.charge(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. |

refund

The data and description for params as the same as for charge function.

api.refund(data, callbackFunc);

unblock

The data and description for params as the same as for charge function.

api.unblock(data, callbackFunc);

getState

var data = {
    Key : 'YourMerchantAccount',
    OrderId : 'ORD00000000000000001'
};
api.getState(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | Key | YourMerchantAccount | | OrderId | Payment identifier in your service system. |


Payture InPay

For use this API just create instanse of PaytureInPay object:

var inpay = new payture.InPay('https://sandbox.payture.com', { Key : 'YourMerchantAccount', Password : 'YourPassword' });

Please note, that { Key : 'YourMerchantAccount', Password : 'YourPassword' } - fake account, our support help you to get one!

API Functions:

init

var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    IP : '127.0.0.1',
    SessionType	 : 'Pay',
    Url : 'payture.com',
    TemplateTag : '',
    Language : 'RU',
    Total : 1,
    Product : 'Something'
};
inpay.init(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | IP | Customer's IP. | | SessionType | 'Pay' - for 1-stage payment, 'Block' - for 2-stage payment. | | Url | The url for return customer after completion of payment. | | TemplateTag | Used template. | | Language | Template language. |

pay

var sessionId = 'e5c43d9f-2646-42bc-aeec-0b9005ceb972'; //retrived from init response
inpay.pay(sessionId, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | sessionId | Payment identifier. Given by init response |

charge

var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
};
inpay.charge(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. |

refund

The data and description for params as the same as for charge function.

api.refund(data, callbackFunc);

unblock

The data and description for params as the same as for charge function.

api.unblock(data, callbackFunc);

payStatus

var orderId : 'ORD00000000000000001';
inpay.payStatus(orderId, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. |


Payture eWallet

For use this API just create instanse of PaytureEWallet object:

var ew = new payture.EWallet('https://sandbox.payture.com', { Key : 'YourMerchantAccount', Password : 'YourPassword' });

Please note, that { Key : 'YourMerchantAccount', Password : 'YourPassword' } - fake account, our support help you to get one!

API Functions:

Payment functions:

init
var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    IP : '127.0.0.1',
    SessionType	 : 'Pay',
    CardId : '40252318-de07-4853-b43d-4b67f2cd2077',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    PhoneNumber : '79001234567',
    TemplateTag : '',
    Language : 'RU',
};
ew.init(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | IP | Customer's IP. | | SessionType | 'Pay' - for 1-stage payment, 'Block' - for 2-stage payment, 'Add' - for register card. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | PhoneNumber | Customer's phone number. | | CardId | Card's identifier. | | TemplateTag | Used template. | | Language | Template language. |

merchantPayRegCard
var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    IP : '127.0.0.1',
    SecureCode	 : 123,
    CardId : '40252318-de07-4853-b43d-4b67f2cd2077',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
};
ew.merchantPayRegCard(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | IP | Customer's IP. | | SecureCode | CVC2/CVV2. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardId | Card's identifier. | | ConfirmCode | Confirm code from SMS - if verification code was requested. | | CustomFields | Addition information about customer. |

merchantPayNoRegCard
var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    IP : '127.0.0.1',
    SecureCode	 : 123,
    CardId : 'FreePay',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    CardHolder : 'Vasya Petrov',
    CardNumber : '4111111111111112',
    EMonth : 10,
    EYear : 20,
};
ew.merchantPayNoRegCard(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | IP | Customer's IP. | | SecureCode | CVC2/CVV2. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardNumber | Card's number. | | EMonth | The expiry month of card. | | EYear | The expiry year of card. | | CardHolder | Card's holder name. | | CardId | Card's identifier. | | ConfirmCode | Confirm code from SMS - if verification code was requested. | | CustomFields | Addition information about customer. |

payturePay
var sessionId = 'e5c43d9f-2646-42bc-aeec-0b9005ceb972'; 
ew.payturePay(sessionId, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | sessionId | Value extracted from init response (where SessionType=Pay(Block)) |

charge
var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
};
ew.charge(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. |

refund

The data and description for params as the same as for charge function.

ew.refund(data, callbackFunc);
unblock

The data and description for params as the same as for charge function.

ew.unblock(data, callbackFunc);
payStatus
var data = {
    OrderId : 'ORD00000000000000001'
};
ew.payStatus(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. |

sendCode
var data = {
    OrderId : 'ORD00000000000000001',
    Amount : 10000,
    CardId : '40252318-de07-4853-b43d-4b67f2cd2077',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363'
};
ew.sendCode(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | OrderId | Payment identifier in your service system. | | Amount | Amount of payment kopec. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardId | Card's identifier. |

Customer functions:

registerCustomer
var data = {
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    PhoneNumber : '79156783333'
};
ew.registerCustomer(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | PhoneNumber | Customer's phone number. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | Email | Customer's email. |

deleteCustomer
var data = {
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    PhoneNumber : '79156783333'
};
ew.deleteCustomer(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). |

updateCustomer

The description for params as the same as for registerCustomer function.

var data = {
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    PhoneNumber : '79156783333'
    Email : '[email protected]'
};
ew.updateCustomer(data, callbackFunc);
checkCustomer
var data = {
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
};
ew.checkCustomer(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. |

Card functions:

merchantAddCard
var data = {
    SecureCode	 : 123,
    PhoneNumber : '79001234567',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
    CardHolder : 'Vasya Petrov',
    CardNumber : '4111111111111112',
    EMonth : 10,
    EYear : 20,
};
ew.merchantAddCard(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | SecureCode | CVC2/CVV2. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardNumber | Card's number. | | EMonth | The expiry month of card. | | EYear | The expiry year of card. | | CardHolder | Card's holder name. | | PhoneNumber | Card's identifier. |

paytureAddCard
var sessionId = 'e5c43d9f-2646-42bc-aeec-0b9005ceb972'; 
ew.paytureAddCard(sessionId, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ------------------------------------------------------------| | sessionId | Value extracted from init response (where SessionType=Add). |

activateCard
var data = {
    Amount : 101,
    CardId : '40252318-de07-4853-b43d-4b67f2cd2077',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
};
ew.activateCard(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | Amount | Amount of payment kopec. | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardId | Card's identifier. |

removeCard
var data = {
    CardId : '40252318-de07-4853-b43d-4b67f2cd2077',
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
};
ew.removeCard(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. | | CardId | Card's identifier. |

getCardList
var data = {
    VWUserLgn : '[email protected]',
    VWUserPsw : '2645363',
};
ew.getCardList(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | VWUserLgn | Customer's identifier in Payture system. (Email is recommended). | | VWUserPsw | Customer's password in Payture system. |


Payture ApplePay

For use this API just create instanse of PaytureAppleApi object:

var apple = new payture.ApplePay('https://sandbox.payture.com',  { Key : 'YourMerchantAccount', Password : 'YourPassword' });

Please note, that { Key : 'YourMerchantAccount', Password : 'YourPassword' } - fake account, our support help you to get one!

API Functions:

pay

var data = {
    PayToken : 'abcdefg',
    OrderId : 'ORD00000000000000001',,
};
apple.pay(data, callbackFunc);

Description of provided params.

| Parameter's name | Definition | | ---------------- | ----------------------------------------------------------------- | | PayToken | PaymentData from PayToken for current transaction | | OrderId | Payment identifier in your service system |

block

The data and description for params as the same as for pay function.

apple.block(data, callbackFunc);

Visit our site for more information. You can find our contact here.