Metadata-Version: 2.4
Name: threeypay-sdk
Version: 1.1.0
Summary: 3ypay (汇联支付) Python SDK - 统一支付、查询、退款、转账、分账等
Author-email: 3YPay Team <support@3ypay.com>
License: MIT
Project-URL: Homepage, https://gitee.com/threeypay/threeypay-python-sdk
Project-URL: Source, https://gitee.com/threeypay/threeypay-python-sdk
Project-URL: Issues, https://gitee.com/threeypay/threeypay-python-sdk/issues
Project-URL: Documentation, https://doc.3ypay.com/
Keywords: payment,3ypay,alipay,wechat,unionpay,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: cryptography>=38.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# 3YPay Python SDK

[![PyPI version](https://badge.fury.io/py/threeypay-sdk.svg)](https://badge.fury.io/py/threeypay-sdk)
[![Python Version](https://img.shields.io/pypi/pyversions/threeypay-sdk.svg)](https://pypi.org/project/threeypay-sdk/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

### V1.1.0。请务必参照对接文档进行对接

1. **3ypay (汇联支付) Python SDK**，支持统一支付、交易查询、退款、转账、分账等功能。
2. **具体参数说明**，请查看 [API文档](https://doc.3ypay.com/)。
3. **请务必对照文档进行配置**，并确保代码正确运行。

## 安装

```bash
pip install threeypay-sdk
```

## 快速开始

### 1. 初始化 SDK

```python
from threeypay import ThreeYPay

# 配置参数
app_id = "YOUR_APP_ID"                    # 应用 APPID
private_key = "YOUR_PRIVATE_KEY"          # 商户私钥 (RSA2)
platform_public_key = "YOUR_PLATFORM_PUBLIC_KEY"  # 平台公钥
is_sandbox = True                         # 是否使用测试环境

# 初始化 SDK
pay = ThreeYPay(app_id, private_key, platform_public_key, is_sandbox)
```

### 2. 支付宝扫码支付

```python
import time

result = pay.payment().alipay(
    mch_order_no=f"ORDER_{int(time.time() * 1000)}",
    order_amount="0.01",
    subject="测试商品",
    description="商品描述",
    notify_url="https://yourdomain.com/notify",
    client_ip="127.0.0.1",
    expired_time=int(time.time() * 1000) + 30*60*1000
)

print(result)
```

### 3. 交易查询

```python
result = pay.payment().query_by_pay_order_no("P202603062034302534880")
print(result)
```

## 功能模块

- **Payment** - 支付模块（支付宝、微信、银联等）
- **Transfer** - 转账模块（安全发、直付通）
- **ProfitSharing** - 分账模块
- **Account** - 账户管理模块
- **Merchant** - 商户管理模块

## 文档

完整API文档：https://doc.3ypay.com/

## License

MIT
