From 595ceb9bf636bfc8db4525fbba26410b71a506a3 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 05:02:36 +0000 Subject: automatic import of python-cardpay --- .gitignore | 1 + python-cardpay.spec | 517 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 519 insertions(+) create mode 100644 python-cardpay.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..b57faa8 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/cardpay-3.46.23.tar.gz diff --git a/python-cardpay.spec b/python-cardpay.spec new file mode 100644 index 0000000..cf502f0 --- /dev/null +++ b/python-cardpay.spec @@ -0,0 +1,517 @@ +%global _empty_manifest_terminate_build 0 +Name: python-cardpay +Version: 3.46.23 +Release: 1 +Summary: Unlimint APIv3 Python SDK +License: MIT +URL: https://github.com/cardpay/python-sdk-v3.git +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9b/06/05ca445b0894351025078c2a23bf021cef26675fde664629b3f97f185d33/cardpay-3.46.23.tar.gz +BuildArch: noarch + +Requires: python3-certifi +Requires: python3-dateutil +Requires: python3-six +Requires: python3-urllib3 + +%description +# Unlimint APIv3 Python SDK + +You can sign up for a Unlimint account at https://www.unlimint.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.46.23' --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"). + + + + +%package -n python3-cardpay +Summary: Unlimint APIv3 Python SDK +Provides: python-cardpay +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-cardpay +# Unlimint APIv3 Python SDK + +You can sign up for a Unlimint account at https://www.unlimint.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.46.23' --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"). + + + + +%package help +Summary: Development documents and examples for cardpay +Provides: python3-cardpay-doc +%description help +# Unlimint APIv3 Python SDK + +You can sign up for a Unlimint account at https://www.unlimint.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.46.23' --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"). + + + + +%prep +%autosetup -n cardpay-3.46.23 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-cardpay -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 3.46.23-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..18342d6 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +51f23c54758cca63c235b0b16c3c9f1e cardpay-3.46.23.tar.gz -- cgit v1.2.3