1.0.9 • Published 4 years ago

@tripartie/webapi-jsclient v1.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

TripartieWebAPI - JSClient

The Tripartie Web API allows you to easily create Transaction templates. Those templates allows a User (the Buyer) to quickly initiate a Transaction pre-configured by another User (the Seller). This allows you to add a Secured Payment button on your website pages.

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

Using npm

npm install @tripartie/webapi-jsclient --save

In <script> HTML tag

<script src="https://cdn.jsdelivr.net/npm/@tripartie/webapi-jsclient/dist/tripartiewebapi-jsclient.min.js"></script>

Getting Started

Please follow the installation instruction and execute the following JS code:

// Only if using with npm. This is not required with `<script>` tag.
const TripartieWebAPI = require('@tripartie/webapi-jsclient');

const defaultClient = TripartieWebAPI.ApiClient.instance;
const ClientIdAuth = defaultClient.authentications['ClientIdAuth'];
ClientIdAuth.apiKey = "YOUR CLIENT ID"

const usersApi = new TripartieWebAPI.UsersApi();
const user = {
    email: "john.doe@gmail.com",
    externalId: "johndoe42",
};
usersApi.register(user)
    .then((user) => {
        console.log('User registered', user);
    })
    .catch((err) => {
        console.error('Could not register user', err);
    });

const transactionTemplatesApi = new TripartieWebAPI.TransactionTemplatesApi()
const template = {
    title: "Playstation 5",
    description: "Brand new",
    subTotal: 50000,
    externalId: "playstation5-436",
    sellerExternalId: "johndoe42",
    currency: "EUR",
    flow: "objects",
    adUrl: "https://my-website.com/ads/playstation5-436",
};
transactionTemplatesApi.create(template)
    .then((transactionTemplate) => {
        console.log('Transaction template created', transactionTemplate);
    })
    .catch((err) => {
        console.error('Could not create transaction template', err);
    });

Documentation for API Endpoints

All URIs are relative to https://platform.preprod.tripartie.com

ClassMethodHTTP requestDescription
TripartieWebAPI.TransactionTemplatesApifetchGET /api/web/transaction-templates/Fetch
TripartieWebAPI.TransactionTemplatesApicreatePOST /api/web/transaction-templates/Create
TripartieWebAPI.UsersApiunregisterDELETE /api/web/users/Unregister
TripartieWebAPI.UsersApifetchGET /api/web/users/Fetch
TripartieWebAPI.UsersApiregisterPOST /api/web/users/Register
TripartieWebAPI.WebhooksApivalidateGET /api/web/webhooks/Validate

Documentation for Models

Documentation for Authorization

ClientIdAuth

  • Type: API key
  • API key parameter name: client-id
  • Location: URL query string

Troubleshooting

Webpack

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}
1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago