1.0.27 • Published 5 years ago
@singleware/payzen v1.0.27
PayZen
Rest client for the PayZen gateway, for more info, please check the Official Documentation
Usage
Authorizing the connection.
import * as PayZen from '@singleware/payzen';
import * as Injection from '@singleware/injection';
// Basic authorization.
Injection.resolve(PayZen.Client).setAuthorization('USER', 'SECRET');
Creating new credit card token.
import * as PayZen from '@singleware/payzen';
import * as Injection from '@singleware/injection';
// Getting a promise to receive the credit card token.
const promise = Injection.resolve(PayZen.Tokens.Mapper).create({
currency: PayZen.Types.Currency.BRL,
customer: {
email: 'customer@email.br'
},
paymentForms: [
{
paymentMethodType: PayZen.Types.Payment.Method.Card,
pan: 'CARD_NUMBER',
expiryMonth: 'CARD_MONTH',
expiryYear: 'CARD_YEAR',
securityCode: 'CARD_CVV'
}
]
});
Creating a new payment based on the received card token.
import * as PayZen from '@singleware/payzen';
import * as Injection from '@singleware/injection';
// Getting a promise to receive the payment uuid.
const promise = Injection.resolve(PayZen.Payments.Mapper).create({
amount: 1000,
currency: PayZen.Types.Currency.BRL,
paymentMethodToken: 'CARD_TOKEN',
customer: {
email: 'customer@email.br'
}
});
Creating a new subscription based on the received card token.
import * as PayZen from '@singleware/payzen';
import * as Injection from '@singleware/injection';
// Getting a promise to receive the subscription id.
const promise = Injection.resolve(PayZen.Payments.Mapper).create({
amount: 1000,
currency: PayZen.Types.Currency.BRL,
effectDate: new Date(),
paymentMethodToken: 'CARD_TOKEN',
rrule: 'RRULE:FREQ=MONTHLY;BYMONTHDAY=1;COUNT=1',
customer: {
email: 'customer@email.br'
}
});
Install
Using npm:
npm i @singleware/payzen
License
1.0.27
5 years ago
1.0.26
5 years ago
1.0.25
5 years ago
1.0.24
5 years ago
1.0.23
5 years ago
1.0.22
5 years ago
1.0.21
5 years ago
1.0.20
5 years ago
1.0.19
5 years ago
1.0.18
5 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.11
5 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago