Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 493 Bytes

README.md

File metadata and controls

22 lines (16 loc) · 493 Bytes

Spreedly API Client

Simple typescript/javascript client for the spreedly API

import Client from 'spreedly';

const client = new Client(environment, token);

const GATEWAY_ID = '123';

const { token } = await client.createCreditCard(email, {
    fullName,
    number,
    month,
    year,
    verificationValue,
}, { userId: '1' });

await client.retainCreditCard(token);
await client.purchase(GATEWAY_ID, { amount: 100, currencyCode: 'USD', paymentMethodToken: token });