Socket
Socket
Sign inDemoInstall

spreedly

Package Overview
Dependencies
4
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.7

6

build/index.d.ts

@@ -15,9 +15,11 @@ import { AxiosInstance } from 'axios';

export declare type CreditCard = {
fullName: string;
fullName?: string;
firstName: string;
lastName: string;
number: string;
email: string;
verificationValue: string;
trackData: any;
cardType: string;
month: string;
year: string;
};

@@ -24,0 +26,0 @@ export declare type Meta = {

@@ -11,2 +11,12 @@ "use strict";

};
const snake = (string) => string.replace(/[\w]([A-Z])/g, (m) => {
return m[0] + "_" + m[1];
}).toLowerCase();
const request = (data) => {
const params = {};
for (const key in data) {
params[snake(key)] = data[key];
}
return params;
};
class Client {

@@ -27,3 +37,4 @@ constructor(environment, secret, options = {}) {

createCreditCard(email, card, meta) {
return this.httpClient.post('payment_methods.json', { email, metadata: meta, payment_method: { credit_card: card } });
const params = request(card);
return this.httpClient.post('payment_methods.json', { email, metadata: meta, payment_method: { credit_card: params } });
}

@@ -30,0 +41,0 @@ retainCreditCard(token) {

{
"name": "spreedly",
"version": "0.0.6",
"version": "0.0.7",
"description": "spreedly api client",

@@ -5,0 +5,0 @@ "main": "./build/index.js",

# Spreedly API Client
```javascript
import Client from 'spreedly';
const client = new Client(environment, token);
const { token } = await client.createCreditCard(email, {
fullName,
number,
month,
year,
verificationValue,
}, { userId: '1' });
await client.retainCreditCard(token);
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc