New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@yosle/tropipayjs

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@yosle/tropipayjs - npm Package Compare versions

Comparing version 0.1.12 to 0.1.13

21

index.d.ts

@@ -303,4 +303,23 @@ import { Axios } from 'axios';

declare class PaymentCard {
private tropipay;
constructor(tropipayInstance: Tropipay);
/**
* Create a paymentLink with the specified options.
* @param payload PaymentLinkPayload Object.
* @returns Promise<PaymentLink> or throws an Exception.
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/b3A6ODgyNTM3OQ-create-a-new-pay-link-charge
*/
create(payload: PaymentLinkPayload): Promise<PaymentLink>;
/**
* Shows a list of stored paymentcards created by user.
* This list includes active and closed paylinks
* @returns Array of paymentlinks
*/
list(): Promise<any>;
get(id: string): Promise<any>;
}
declare const SERVER_MODE: ServerMode$1;
export { AccountBalance, AccountDeposits, ClientSideUtils, Country, Deposit, HookEventType, HookTargetType, LoginError, LoginResponse, PaymentLink, PaymentLinkPayload, SERVER_MODE, ServerMode$1 as ServerMode, ServerSideUtils, Tropipay, TropipayConfig, TropipayCredentials, TropipayHooks, UserHook, UserHookSubscribed, mediationPaymentCardConfig };
export { AccountBalance, AccountDeposits, ClientSideUtils, Country, Deposit, HookEventType, HookTargetType, LoginError, LoginResponse, PaymentCard, PaymentLink, PaymentLinkPayload, SERVER_MODE, ServerMode$1 as ServerMode, ServerSideUtils, Tropipay, TropipayConfig, TropipayCredentials, TropipayHooks, UserHook, UserHookSubscribed, mediationPaymentCardConfig };

@@ -439,2 +439,74 @@ 'use strict';

class PaymentCard {
tropipay;
constructor(tropipayInstance) {
this.tropipay = tropipayInstance;
}
/**
* Create a paymentLink with the specified options.
* @param payload PaymentLinkPayload Object.
* @returns Promise<PaymentLink> or throws an Exception.
* @see https://tpp.stoplight.io/docs/tropipay-api-doc/b3A6ODgyNTM3OQ-create-a-new-pay-link-charge
*/
async create(payload) {
if (!Tropipay.accessToken) {
await this.tropipay.login();
}
try {
const paylink = await this.tropipay.request.post("/api/v2/paymentcards", payload, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${Tropipay.accessToken}`,
Accept: "application/json",
},
});
return paylink.data;
}
catch (error) {
throw new Error(`TropipayJS - Error creating the Payment Card.`);
}
}
/**
* Shows a list of stored paymentcards created by user.
* This list includes active and closed paylinks
* @returns Array of paymentlinks
*/
async list() {
if (!Tropipay.accessToken) {
await this.tropipay.login();
}
try {
const paymentcards = await this.tropipay.request.get(`/api/v2/paymentcards`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${Tropipay.accessToken}`,
Accept: "application/json",
},
});
return paymentcards.data;
}
catch (error) {
throw new Error(`Could not retrieve PaymenCards list`);
}
}
async get(id) {
if (!Tropipay.accessToken) {
await this.tropipay.login();
}
try {
const paymentcard = await this.tropipay.request.get(`/api/v2/paymentcards/${id}`, {
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${Tropipay.accessToken}`,
Accept: "application/json",
},
});
return paymentcard.data;
}
catch (error) {
throw new Error(`Could not retrieve PaymenCards`);
}
}
}
const SERVER_MODE = "Development"; // Move the constant here

@@ -458,2 +530,3 @@

exports.ClientSideUtils = ClientSideUtils;
exports.PaymentCard = PaymentCard;
exports.SERVER_MODE = SERVER_MODE;

@@ -460,0 +533,0 @@ exports.ServerSideUtils = ServerSideUtils;

2

package.json
{
"name": "@yosle/tropipayjs",
"version": "0.1.12",
"version": "0.1.13",
"description": "Javascript / Typescript SDK for the Tropipay API",

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

@@ -23,4 +23,5 @@ /**

export { TropipayHooks } from "./hooks/TropipayHooks";
export { PaymentCard } from "./paymentcard/PaymentCard";
export * from "./interfaces/index";
export { SERVER_MODE } from "./config/TropipayConfig";
export * from "./constants/TropipayConstants";
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc