# Orders, Payments and Subscriptions

Connected orders, wallet top-ups, payment channels, subscription renewals and refunds for a cloud-phone platform, with attention to financial and resource state consistency.

- Author: Dianhai Wang
- Source: https://cv.dancelight.cn/en/projects/payments/
- Updated: 2026-11-17

Work project · Guangzhou Yunxi Guangnian

## My contribution

I implemented UPay and Payssion payment callbacks and wallet credits. Each callback validates the signature, amount and currency. A database transaction and conditional state update prevent duplicate notifications from crediting the wallet twice.

## Context

A work project at Guangzhou Yunxi Guangnian. Developed order and payment systems, integrated UPay and Payssion, and covered purchases, wallet top-ups, subscriptions, renewals, expiry and refunds.

## Technologies

Go, go-zero, MySQL, Redis, UPay / Payssion

## Workflow

Create order → Payment channel → Callback and transaction → Wallet / subscription

## Implementation

### Handle requests and callbacks

Implemented payment requests, callbacks and wallet credits. Validated signatures, amounts and currencies, and maintained order states and wallet transaction records.

### Prevent duplicate crediting

Combined database transactions and conditional order-state updates to prevent duplicate payment notifications from crediting a wallet twice.

### Coordinate money and resources

Connected purchase, renewal and expiry states for cloud phones. Investigated cases where payment and resource states disagreed.

### Apply refund constraints

Checked associated orders and refundable amounts, and recorded balance changes and refund transactions.

## Delivery and scope

Implemented UPay and Payssion integrations across payment callbacks, financial records, refunds and subscription lifecycles, using transactions and conditional state updates to prevent duplicate credits.

## Other projects

- [Network Proxy and Video Forwarding](https://cv.dancelight.cn/en/projects/network-platform/)
- [Sales Knowledge Agent](https://cv.dancelight.cn/en/projects/sales-agent/)
