sdk-typescript
TypeScript icon, indicating that this package has built-in type declarations

1.2.42 • Public • Published

typescript-sdk

Usage

1- Download npm package

npm install <package_name>

2- Import package to the desire component

import * as sdk from '<package_name>'

3- Create a client instance from SpPaymentClient class

const client = new sdk.SpPaymentClient(
    {
            ApiKey : "Your api key",
            AppId : "Your app id",
            BaseUrl : "https://payment.tryspare.com"
    }
)

4 - Implement Domestic Payment api

  • List Payments
const payments = await client.ListDomesticPayments(0, 10)
  • Get Payment
const payment = await client.GetDomesticPayment('d214857b-d654-48a0-b039-42b46b0e2')
  • Create Payment

// Initialize payment

const payment = await client.CreateDomesticPayment({
        Amount : 10,
        Description : "Test domestic payment",
}, signature)

Readme

Keywords

none

Package Sidebar

Install

npm i sdk-typescript

Weekly Downloads

73

Version

1.2.42

License

none

Unpacked Size

35.4 kB

Total Files

44

Last publish

Collaborators

  • yassinbt