Skip to content

ChanMo/bitpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BitPay

TRON(USDT)支付服务

用户创建订单时, 系统会为当前订单分配一个可用的钱包地址 (如果无可用地址, 就创建一个新地址). 订单创建时自动设置截止时间(10分钟)

系统会监听Pending状态订单的钱包地址的交易记录, 如果有新的入账操作, 则增加订单记录 当订单记录中的入账总额大于或等于订单金额时, 标记为成功, 并设置钱包为可用 当订单超时时, 设置钱包为可用

启动服务

启动TRON API

$ docker run -p 3000:3000 chanmo/tron-api

Environment Variable List:

  • TRON_API_KEY
  • NETWORK: choose one of Nile, or Mainnet

启动BitPay API

$ docker run -p 5000:8000 chanmo/bitpay

Environment Variable List:

  • TRON_API: The URL of the tron API instance, for example, http://0.0.0.0:3000
  • TRON_USDT: The USDT contract address in TRON.
  • PAYMENT_RESULT_NOTIFY: The URL for receiving the notification of payment status change.

API

Create a payment order

http POST :8000/orders/ user=demo [email protected] amount=1000000

List all orders

http :8000/orders/

Delete an order

http DELETE :8000/orders/<order_number>/

List all accounts

http :8000/accounts/