cardpay


Namecardpay JSON
Version 3.68.8 PyPI version JSON
download
home_pagehttps://github.com/cardpay/python-sdk-v3.git
SummaryUnlimit APIv3 Python SDK
upload_time2024-04-18 09:30:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseMIT
keywords cardpay apiv3 cardpay rest api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Unlimit APIv3 Python SDK

You can sign up for a Unlimit account at https://www.unlimit.com

## Getting Started

Please follow the [installation](#installation) instruction and take a look at [usage examples](tests).


## Requirements

Python 3+

## Installation & Usage
### pip install

If the python package is hosted on Github, you can install directly from Github

```sh
pip install git+https://github.com/cardpay/python-sdk-v3.git --upgrade
```
or

```sh
pip install 'cardpay>=3.68.8' --upgrade
```

Then import the package:
```python
from cardpay import *
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```

Then import the package:
```python
from cardpay import *
```

## Usage examples

Example for Auth
```python
import os
from cardpay import *

CARDPAY_API_URL = os.getenv('CARDPAY_API_URL', 'https://sandbox.cardpay.com')
GATEWAY_TERMINAL_CODE = os.getenv('GATEWAY_TERMINAL_CODE', '00000')
GATEWAY_PASSWORD = os.getenv('GATEWAY_PASSWORD', 'password')

auth = AuthApi(ApiClient(baseUrl=CARDPAY_API_URL))

result = auth.obtain_tokens(
    grant_type="password",
    terminal_code=GATEWAY_TERMINAL_CODE,
    password=GATEWAY_PASSWORD
)

access_token = result.access_token
refresh_token = result.refresh_token

print('access_token:',access_token)
print('refresh_token:', refresh_token)
```

Example for payment
```python
import os
from cardpay import *

CARDPAY_API_URL = os.getenv('CARDPAY_API_URL', 'https://sandbox.cardpay.com')
GATEWAY_TERMINAL_CODE = os.getenv('GATEWAY_TERMINAL_CODE', '00000')
GATEWAY_PASSWORD = os.getenv('GATEWAY_PASSWORD', 'password')

config = Configuration(
    base_url=CARDPAY_API_URL,
    terminal_code=GATEWAY_TERMINAL_CODE,
    password=GATEWAY_PASSWORD
)
payments = PaymentsApi(ApiClient(config))

request = PaymentRequest(
    request=ApiClient.uuid_request(),
    merchant_order=PaymentRequestMerchantOrder(
        id='merchant order id',
        description='merchant description'
    ),
    card_account=PaymentRequestCardAccount(
        card=PaymentRequestCard(
            pan='card pan',
            holder='cardholder in Upper Case',
            expiration='expiration date',
            security_code='123'
        ),
        billing_address = BillingAddress(
            country='USA',
            state='NY',
            zip='10001',
            city='New York',
            addr_line_1='address1',
            addr_line_2='address2'
        )
    ),
    customer=PaymentRequestCustomer(
        id='000',
        full_name='full name',
        birth_date='birth date',
        email='e-mail',
        phone='+###########',
        work_phone='+###########',
        home_phone='+###########',
        locale='en'
    ),
    payment_method="BANKCARD",
    payment_data=PaymentRequestPaymentData(
        currency="currency",
        amount=1.23
    )
)

create_payment_response = payments.create_payment(request)
payment_id = create_payment_response.payment_data.id
redirect_url = create_payment_response.redirect_url

print("payment_id:", payment_id);
print("redirect_url:", redirect_url);

payment_response = payments.get_payment(payment_id)
print('payment_response:', payment_response)
print('payment_status:', payment_response.payment_data.status)
```


## Proxy usage

The SDK will automatically use a proxy if the `HTTPS_PROXY` or `HTTP_PROXY` environment variable is set.

If the `NO_PROXY` env variable is set, the SDK won't use the proxy for hosts from this variable. The format of
`NO_PROXY`: comma separated domain names (e.g. "cardpay.com,.example.com").



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cardpay/python-sdk-v3.git",
    "name": "cardpay",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "cardpay, APIv3, CardPay REST API",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/c3/4c/303b0bc402ef93364de6f2c1c7705573741a9b109144e467b59aef123cec/cardpay-3.68.8.tar.gz",
    "platform": null,
    "description": "# Unlimit APIv3 Python SDK\n\nYou can sign up for a Unlimit account at https://www.unlimit.com\n\n## Getting Started\n\nPlease follow the [installation](#installation) instruction and take a look at [usage examples](tests).\n\n\n## Requirements\n\nPython 3+\n\n## Installation & Usage\n### pip install\n\nIf the python package is hosted on Github, you can install directly from Github\n\n```sh\npip install git+https://github.com/cardpay/python-sdk-v3.git --upgrade\n```\nor\n\n```sh\npip install 'cardpay>=3.68.8' --upgrade\n```\n\nThen import the package:\n```python\nfrom cardpay import *\n```\n\n### Setuptools\n\nInstall via [Setuptools](http://pypi.python.org/pypi/setuptools).\n\n```sh\npython setup.py install --user\n```\n\nThen import the package:\n```python\nfrom cardpay import *\n```\n\n## Usage examples\n\nExample for Auth\n```python\nimport os\nfrom cardpay import *\n\nCARDPAY_API_URL = os.getenv('CARDPAY_API_URL', 'https://sandbox.cardpay.com')\nGATEWAY_TERMINAL_CODE = os.getenv('GATEWAY_TERMINAL_CODE', '00000')\nGATEWAY_PASSWORD = os.getenv('GATEWAY_PASSWORD', 'password')\n\nauth = AuthApi(ApiClient(baseUrl=CARDPAY_API_URL))\n\nresult = auth.obtain_tokens(\n    grant_type=\"password\",\n    terminal_code=GATEWAY_TERMINAL_CODE,\n    password=GATEWAY_PASSWORD\n)\n\naccess_token = result.access_token\nrefresh_token = result.refresh_token\n\nprint('access_token:',access_token)\nprint('refresh_token:', refresh_token)\n```\n\nExample for payment\n```python\nimport os\nfrom cardpay import *\n\nCARDPAY_API_URL = os.getenv('CARDPAY_API_URL', 'https://sandbox.cardpay.com')\nGATEWAY_TERMINAL_CODE = os.getenv('GATEWAY_TERMINAL_CODE', '00000')\nGATEWAY_PASSWORD = os.getenv('GATEWAY_PASSWORD', 'password')\n\nconfig = Configuration(\n    base_url=CARDPAY_API_URL,\n    terminal_code=GATEWAY_TERMINAL_CODE,\n    password=GATEWAY_PASSWORD\n)\npayments = PaymentsApi(ApiClient(config))\n\nrequest = PaymentRequest(\n    request=ApiClient.uuid_request(),\n    merchant_order=PaymentRequestMerchantOrder(\n        id='merchant order id',\n        description='merchant description'\n    ),\n    card_account=PaymentRequestCardAccount(\n        card=PaymentRequestCard(\n            pan='card pan',\n            holder='cardholder in Upper Case',\n            expiration='expiration date',\n            security_code='123'\n        ),\n        billing_address = BillingAddress(\n            country='USA',\n            state='NY',\n            zip='10001',\n            city='New York',\n            addr_line_1='address1',\n            addr_line_2='address2'\n        )\n    ),\n    customer=PaymentRequestCustomer(\n        id='000',\n        full_name='full name',\n        birth_date='birth date',\n        email='e-mail',\n        phone='+###########',\n        work_phone='+###########',\n        home_phone='+###########',\n        locale='en'\n    ),\n    payment_method=\"BANKCARD\",\n    payment_data=PaymentRequestPaymentData(\n        currency=\"currency\",\n        amount=1.23\n    )\n)\n\ncreate_payment_response = payments.create_payment(request)\npayment_id = create_payment_response.payment_data.id\nredirect_url = create_payment_response.redirect_url\n\nprint(\"payment_id:\", payment_id);\nprint(\"redirect_url:\", redirect_url);\n\npayment_response = payments.get_payment(payment_id)\nprint('payment_response:', payment_response)\nprint('payment_status:', payment_response.payment_data.status)\n```\n\n\n## Proxy usage\n\nThe SDK will automatically use a proxy if the `HTTPS_PROXY` or `HTTP_PROXY` environment variable is set.\n\nIf the `NO_PROXY` env variable is set, the SDK won't use the proxy for hosts from this variable. The format of\n`NO_PROXY`: comma separated domain names (e.g. \"cardpay.com,.example.com\").\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Unlimit APIv3 Python SDK",
    "version": "3.68.8",
    "project_urls": {
        "Documentation": "https://integration.unlimit.com/",
        "Homepage": "https://github.com/cardpay/python-sdk-v3.git",
        "Source Code": "https://github.com/cardpay/python-sdk-v3"
    },
    "split_keywords": [
        "cardpay",
        " apiv3",
        " cardpay rest api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cebc447d296ca8986439506aa21097f504e7916999afd3e9544bb1fe890058c",
                "md5": "8f54ef2f360f658fecbc1fe91fcbb3bc",
                "sha256": "b276e3eaf41a2dabbce14d8ffb46455b4fd82a096981507437a79fdc16b49eef"
            },
            "downloads": -1,
            "filename": "cardpay-3.68.8-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8f54ef2f360f658fecbc1fe91fcbb3bc",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3",
            "size": 440183,
            "upload_time": "2024-04-18T09:30:29",
            "upload_time_iso_8601": "2024-04-18T09:30:29.297324Z",
            "url": "https://files.pythonhosted.org/packages/6c/eb/c447d296ca8986439506aa21097f504e7916999afd3e9544bb1fe890058c/cardpay-3.68.8-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c34c303b0bc402ef93364de6f2c1c7705573741a9b109144e467b59aef123cec",
                "md5": "d9dcd5f0ef81470001dee24bb5da1ba8",
                "sha256": "e6956a70568aaedfbcbd469d4c9d0ec2a0de37f11700d7009310356e4a833629"
            },
            "downloads": -1,
            "filename": "cardpay-3.68.8.tar.gz",
            "has_sig": false,
            "md5_digest": "d9dcd5f0ef81470001dee24bb5da1ba8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 161524,
            "upload_time": "2024-04-18T09:30:31",
            "upload_time_iso_8601": "2024-04-18T09:30:31.169522Z",
            "url": "https://files.pythonhosted.org/packages/c3/4c/303b0bc402ef93364de6f2c1c7705573741a9b109144e467b59aef123cec/cardpay-3.68.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-18 09:30:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cardpay",
    "github_project": "python-sdk-v3",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "cardpay"
}
        
Elapsed time: 0.28026s