Metadata-Version: 2.4
Name: ps-apimatic-sdk
Version: 0.0.2
Summary: Sample SDKs for PS by APIMatic
Author-email: Muhammad Rafay <muhammad.rafay@apimatic.io>
Project-URL: Documentation, https://paysecure.com/
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: apimatic-core>=0.2.24,~=0.2.0
Requires-Dist: apimatic-core-interfaces>=0.1.8,~=0.1.0
Requires-Dist: apimatic-requests-client-adapter>=0.1.10,~=0.1.0
Requires-Dist: python-dotenv<2.0,>=0.21
Provides-Extra: testutils
Requires-Dist: pytest>=7.2.2; extra == "testutils"
Dynamic: license-file


# Getting Started with Paysecure API Documentation - Live

## Introduction

### Overview

---


Paysecure is a payment gateway optimization and intelligence service that merchants can use to provide a remote and frictionless payment experience.

This documentation will help you get started with integrating Paysecure but if you have any questions, please do not hesitate to reach out to us via email at [info@paysecure.net](https://)

Please be advised that our support team is only available during standard business hours.

### Environments

---


These are the BaseUrls for the APIs on different environments:

| **Environment** | **Base URL** |
| --- | --- |
| Production | [https://api.paysecure.net/api/v1](https://) |
| Sandbox | [https://api.paysecure.net/api/v1](https://)  <br>`Note: set the Sandbox flag true (checked) in your merchant account. As shown in the image below` |

### Authentication

---


To access the API, you must acquire your unique API key from the merchant dashboard -> API Keys section in your account. Make sure to use this key as a **bearer token** in the Authorization header for every request you send.

`AUTHORIZATION: Bearer Token`

`Token: {{APIKey}} .`

Access your sandbox API key credentials by navigating to your merchant login and checking the 'is sandbox' option, located in the top right corner under merchant profile.

<img src="https://content.pstmn.io/dfe64a66-8699-45c8-9f10-b00f7df380b7/U2NyZWVuc2hvdCAyMDIzLTA5LTE1IGF0IDE2LjU2LjQyLnBuZw==">


To get to the live API key, uncheck the **'Is Sandbox'** option in the top right corner of your merchant dashboard. After unchecking, the page will refresh, and you can generate an API key for live transactions in this environment."

<img src="https://content.pstmn.io/afa2574d-8438-4a63-9b29-81feb0f755e5/U2NyZWVuc2hvdCAyMDIzLTA5LTE1IGF0IDE3LjE0LjI4LnBuZw==">


Reiterating, the API keys in Sandbox mode are for testing (when 'is sandbox' is CHECKED in the top right corner under merchant profile). The live API key credentials are for processing actual card transactions in Live mode (when 'is sandbox' is UNCHECKED in the same location)

### Request Headers

---


Use these headers on every API call unless noted.

| Header | Value | Required | Notes |
| --- | --- | --- | --- |
| `Content-Type` | `application/json` | Yes | All endpoints. Send JSON payloads. |
| `Authorization` | `Bearer {MERCHANT_API_KEY}` | Yes | All endpoints.  <br>Replace with your merchant API key. |
| `BrandId` | `{YOUR_BRAND_ID}` | Conditional | **Session** and **Customer**APIs.  <br>optional in customer APIs but Mandatory in Session APIs |

## Install the Package

The package is compatible with Python versions `3.7+`.
Install the package from PyPi using the following pip command:

```bash
pip install ps-apimatic-sdk==0.0.2
```

You can also view the package at:
https://pypi.python.org/pypi/ps-apimatic-sdk/0.0.2

## Initialize the API Client

**_Note:_** Documentation for the client can be found [here.](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/client.md)

The following parameters are configurable for the API Client:

| Parameter | Type | Description |
|  --- | --- | --- |
| environment | [`Environment`](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/README.md#environments) | The API environment. <br> **Default: `Environment.PRODUCTION`** |
| http_client_instance | `Union[Session, HttpClientProvider]` | The Http Client passed from the sdk user for making requests |
| override_http_client_configuration | `bool` | The value which determines to override properties of the passed Http Client from the sdk user |
| http_call_back | `HttpCallBack` | The callback value that is invoked before and after an HTTP call is made to an endpoint |
| timeout | `float` | The value to use for connection timeout. <br> **Default: 30** |
| max_retries | `int` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
| backoff_factor | `float` | A backoff factor to apply between attempts after the second try. <br> **Default: 2** |
| retry_statuses | `Array of int` | The http statuses on which retry is to be done. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
| retry_methods | `Array of string` | The http methods on which retry is to be done. <br> **Default: ["GET", "PUT"]** |
| proxy_settings | [`ProxySettings`](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/proxy-settings.md) | Optional proxy configuration to route HTTP requests through a proxy server. |
| logging_configuration | [`LoggingConfiguration`](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/logging-configuration.md) | The SDK logging configuration for API calls |
| bearer_auth_credentials | [`BearerAuthCredentials`](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/auth/oauth-2-bearer-token.md) | The credential object for OAuth 2 Bearer token |

The API client can be initialized as follows:

### Code-Based Client Initialization

```python
import logging

from paysecureapidocumentationlive.configuration import Environment
from paysecureapidocumentationlive.http.auth.oauth_2 import BearerAuthCredentials
from paysecureapidocumentationlive.logging.configuration.api_logging_configuration import LoggingConfiguration
from paysecureapidocumentationlive.logging.configuration.api_logging_configuration import RequestLoggingConfiguration
from paysecureapidocumentationlive.logging.configuration.api_logging_configuration import ResponseLoggingConfiguration
from paysecureapidocumentationlive.paysecureapidocumentationlive_client import PaysecureapidocumentationliveClient

client = PaysecureapidocumentationliveClient(
    bearer_auth_credentials=BearerAuthCredentials(
        access_token='AccessToken'
    ),
    environment=Environment.PRODUCTION,
    logging_configuration=LoggingConfiguration(
        log_level=logging.INFO,
        request_logging_config=RequestLoggingConfiguration(
            log_body=True
        ),
        response_logging_config=ResponseLoggingConfiguration(
            log_headers=True
        )
    )
)
```

### Environment-Based Client Initialization

```python
from paysecureapidocumentationlive.paysecureapidocumentationlive_client import PaysecureapidocumentationliveClient

# Specify the path to your .env file if it’s located outside the project’s root directory.
client = PaysecureapidocumentationliveClient.from_environment(dotenv_path='/path/to/.env')
```

See the [Environment-Based Client Initialization](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/environment-based-client-initialization.md) section for details.

## Environments

The SDK can be configured to use a different environment for making API calls. Available environments are:

### Fields

| Name | Description |
|  --- | --- |
| PRODUCTION | **Default** |

## Authorization

This API uses the following authentication schemes.

* [`bearer (OAuth 2 Bearer token)`](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/auth/oauth-2-bearer-token.md)

## List of APIs

* [Payin AP Is](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/payin-ap-is.md)
* [Payout AP Is](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/payout-ap-is.md)
* [Get Balance API](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/get-balance-api.md)
* [Refund API](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/refund-api.md)
* [🌎 Paypal Wallet](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/paypal-wallet.md)
* [💳 Virtual Cards Payout](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/virtual-cards-payout.md)
* [Trust Score](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/trust-score.md)
* [Cashier AP Is](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/cashier-ap-is.md)
* [Transaction Reporting](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/transaction-reporting.md)
* [Get Balance API V2-Orchestration](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/get-balance-api-v2-orchestration.md)
* [Global Collection](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/global-collection.md)
* [Payout Manual Review](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/payout-manual-review.md)
* [AP Is](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/ap-is.md)
* [Payout](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/payout.md)
* [Payin](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/payin.md)
* [API](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/controllers/api.md)

## SDK Infrastructure

### Configuration

* [ProxySettings](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/proxy-settings.md)
* [Environment-Based Client Initialization](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/environment-based-client-initialization.md)
* [AbstractLogger](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/abstract-logger.md)
* [LoggingConfiguration](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/logging-configuration.md)
* [RequestLoggingConfiguration](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/request-logging-configuration.md)
* [ResponseLoggingConfiguration](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/response-logging-configuration.md)

### HTTP

* [HttpResponse](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/http-response.md)
* [HttpRequest](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/http-request.md)

### Utilities

* [ApiResponse](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/api-response.md)
* [ApiHelper](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/api-helper.md)
* [HttpDateTime](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/http-date-time.md)
* [RFC3339DateTime](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/rfc3339-date-time.md)
* [UnixDateTime](https://www.github.com/sdks-io/ps-apimatic-python-sdk/tree/0.0.2/doc/unix-date-time.md)

