# swisscom_payments_javascript_sdk

> ERROR_UNKNOWN

Latest version **5.0.17** (published 2017-05-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install swisscom_payments_javascript_sdk
pnpm add swisscom_payments_javascript_sdk
yarn add swisscom_payments_javascript_sdk
bun add swisscom_payments_javascript_sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.17 |
| Published | 2017-05-01 |
| First published | 2017-04-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | swisscom_apis |

## Links

- npm: https://www.npmjs.com/package/swisscom_payments_javascript_sdk
- npm.io page: https://npm.io/package/swisscom_payments_javascript_sdk

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) 1.7.1

## Recent versions

- 5.0.17 (latest) — 2017-05-01
- 5.0.16 — 2017-04-25

## README

# swisscom_payments_javascript_sdk

SwisscomPaymentsJavascriptSdk - JavaScript client for swisscom_payments_javascript_sdk
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 5.0
- Package version: 5.0.17
- Build date: 2017-05-01T15:57:44.009+02:00
- Build package: class io.swagger.codegen.languages.JavascriptClientCodegen

## Installation

### For [Node.js](https://nodejs.org/)

#### npm

To publish the library as a [npm](https://www.npmjs.com/),
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).

Then install it via:

```shell
npm install swisscom_payments_javascript_sdk --save
```

#### git
#
If the library is hosted at a git repository, e.g.
https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:

```shell
    npm install GIT_USER_ID/GIT_REPO_ID --save
```

### For browser

The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):

```shell
browserify main.js > bundle.js
```

Then include *bundle.js* in the HTML pages.

## Getting Started

Please follow the [installation](#installation) instruction and execute the following JS code:

```javascript
var SwisscomPaymentsJavascriptSdk = require('swisscom_payments_javascript_sdk');

var defaultClient = SwisscomPaymentsJavascriptSdk.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth_2_0_authorization_code
var oauth_2_0_authorization_code = defaultClient.authentications['oauth_2_0_authorization_code'];
oauth_2_0_authorization_code.accessToken = "YOUR ACCESS TOKEN"

// Configure OAuth2 access token for authorization: oauth_2_0_client_credentials
var oauth_2_0_client_credentials = defaultClient.authentications['oauth_2_0_client_credentials'];
oauth_2_0_client_credentials.accessToken = "YOUR ACCESS TOKEN"

var api = new SwisscomPaymentsJavascriptSdk.DefaultApi()

var sCSVersion = "sCSVersion_example"; // {String} The version of the API, value must be \"**<<SCS-Version>>**\".  This header indicates which version of the API should serve the request. If the value of the header is missing or it indicates a wrong version, the API returns an error message. 

var paymentRequest = new SwisscomPaymentsJavascriptSdk.PaymentRequest(); // {PaymentRequest} 

var opts = { 
  'sCSRequestID': "sCSRequestID_example" // {String} The request ID.  It is used by the API to trace the fulfillment of a request. The API user may provide its own request ID or can accept the request ID generated by the API. In both cases the request ID is returned in the header of the response.  This ID should be refered by the API users in their communication with Swisscom whenever requesting details about the execution of a request. 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.createPayment(sCSVersion, paymentRequest, opts, callback);

```

## Documentation for API Endpoints

All URIs are relative to *https://api.swisscom.com/*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*SwisscomPaymentsJavascriptSdk.DefaultApi* | [**createPayment**](docs/DefaultApi.md#createPayment) | **POST** /payments | 
*SwisscomPaymentsJavascriptSdk.DefaultApi* | [**getPayment**](docs/DefaultApi.md#getPayment) | **GET** /payments/{paymentId} | 
*SwisscomPaymentsJavascriptSdk.DefaultApi* | [**searchPayments**](docs/DefaultApi.md#searchPayments) | **GET** /payments | 


## Documentation for Models

 - [SwisscomPaymentsJavascriptSdk.Error](docs/Error.md)
 - [SwisscomPaymentsJavascriptSdk.PaymentDetails](docs/PaymentDetails.md)
 - [SwisscomPaymentsJavascriptSdk.PaymentRequest](docs/PaymentRequest.md)
 - [SwisscomPaymentsJavascriptSdk.PaymentRequestPayerId](docs/PaymentRequestPayerId.md)
 - [SwisscomPaymentsJavascriptSdk.PaymentStatus](docs/PaymentStatus.md)
 - [SwisscomPaymentsJavascriptSdk.PaymentsCollection](docs/PaymentsCollection.md)


## Documentation for Authorization


### oauth_2_0_authorization_code

- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://consent.swisscom.com/c/oauth2/auth
- **Scopes**: 
  - read-payment: Allows reading payments.
  - write-payment: Allows writing payments.

### oauth_2_0_client_credentials

- **Type**: OAuth
- **Flow**: application
- **Authorization URL**: 
- **Scopes**: N/A

---
_Source: https://npm.io/package/swisscom_payments_javascript_sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
