Skip to main content

python sdk for benpay merchant

Project description

Python SDK for Benpay merchant API

API Documentation

Installation

pip install benpay_merchant_api_sdk

Usage

Consider /v1/payment/create as a reference, the full code can be located in the demo directory.

  • Get api key info

https://www.benpay.org/paymvp/business

  • create order
import config
import sys
import uuid

sys.path.append("../../")
from benpay_merchant_api_sdk.client import BenpayMerchantClient
import benpay_merchant_api_sdk.param.benpay_merchant_param as benpay_param


client = BenpayMerchantClient(
    api_key=config.API_KEY,
    server=config.SERVER,
    merchant_private_key_string=config.MERCHANT_PRIVATE_KEY_STRING,
    platform_public_key_string=config.PLATFORM_PUBLIC_KEY_STRING
)

param = benpay_param.CreatePayOrderParam()
param.coin = "BUSD"
param.coinAmount = "0.1"
param.out_trade_no = uuid.uuid4().hex
param.merchant_note = "22222"

resp = client.create_pay_order(param)

if resp.status_code == 200:
    print(resp.json())
else:
    print(resp.text)
```%

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benpay_merchant_api_sdk-1.0.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benpay_merchant_api_sdk-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file benpay_merchant_api_sdk-1.0.0.tar.gz.

File metadata

  • Download URL: benpay_merchant_api_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.0 Darwin/22.6.0

File hashes

Hashes for benpay_merchant_api_sdk-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e26efbe58231b9690de4ec482a4ffe0839fbde1d1d42125d2dee1439f3e2a733
MD5 d855cde3187f4ec47a96b08f5ca66daa
BLAKE2b-256 d58c61f0e5e75e41ab96e360e2d964ba7e0a5465c4f67c381ec692195aa2e98d

See more details on using hashes here.

File details

Details for the file benpay_merchant_api_sdk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for benpay_merchant_api_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 454463f8b8f4e33aa8c00ba281ef9143d095bc454e07a418969397b3bcd5c6b6
MD5 8db88f39d9bed2125b6e86b89be4bd10
BLAKE2b-256 fca5cd727c2488d60a5996467940a3ce5172d214610873c5a3f4840af9831ec0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page