@novo-x/spreedly
v1.0.9
Published
Spreedly API core
Downloads
7
Readme
Spreedly Service
Available methods
- pay: makes a charge to the card
- retrieve: returns card details
- recache: recaches the cvv. It makes it available to spreedly for a few minutes
- verify: verifies the card
Usage examples
yarn add @novo-x/spreedly
import {Spreedly} from "@novo-x/spreedly"
const MyService = new Spreedly(
'123456789' // apiKey,
);
const payment = await MyService.pay(
'123456789', // cardToken
'123456789', // gatewayToken
{
payment_method_token: '123456789', // cardToken
amount: 20,
currency_code: "EUR",
retain_on_success: true,
gateway_specific_fields: {
stripe: {
destination: '123456789', // stripeConnectId
application_fee_amount: 5, // fee
destination_amount: 15, // amount to seller
statement_description: "Novo-X Purchase",
}
}
} // transactionConfig
);
const card = await MyService.retrieve(
'123456789' // cardToken
);
const recached = await MyService.recache(
'123', // CVC
'123456789' // cardToken
)
const verified = await MyService.verify(
'123456789', // cardToken,
'123456789', // gatewayToken
'EUR' // currency
)