mirror of
https://gitee.com/dromara/dax-pay.git
synced 2025-09-07 13:10:44 +00:00
43 lines
1.9 KiB
Plaintext
43 lines
1.9 KiB
Plaintext
@startuml
|
|
autonumber
|
|
skinparam responseMessageBelowArrow true
|
|
|
|
title 支付代码时序图-以支付宝支付为例
|
|
|
|
actor 客户端 as Client
|
|
participant PayService
|
|
participant PayOrderService
|
|
participant PayAssistService
|
|
participant AliPayStrategy
|
|
participant PayStrategyFactory
|
|
participant AliPayService
|
|
participant ClientNoticeService
|
|
|
|
Client -> PayService: 发送请求
|
|
PayService --> PayAssistService: 校验支付状态
|
|
PayService --> PayAssistService: 初始化上下文
|
|
PayService -> PayService: 调用首次支付方法
|
|
PayService -> PayAssistService: 创建支付订单和扩展记录并保存
|
|
PayService <- PayAssistService: 返回支付订单对象
|
|
PayService -> PayService: 调用支付方法进行发起支付
|
|
PayService -> PayStrategyFactory: 通过工厂生成对应的策略组
|
|
PayService <- PayStrategyFactory: 返回支付策略组
|
|
PayService -> AliPayStrategy: 执行支付前处理动作
|
|
AliPayStrategy --> AliPayStrategy: 支付宝参数验证和反序列化通道支付参数
|
|
AliPayStrategy -> AliPayService: 检查并获取支付宝配置, 同时校验支付相关信息
|
|
AliPayStrategy <- AliPayService: 返回检查结果和支付配置
|
|
PayService <- AliPayStrategy: 支付前处理完成
|
|
AliPayStrategy -> AliPayService: 调用网关接口进行进行支付
|
|
AliPayService -> 支付宝支付网关: 根据情况调用对应类型的支付
|
|
AliPayService <- 支付宝支付网关: 返回支付调用结果
|
|
AliPayStrategy <- AliPayService: 返回支付结构体或者支付结果(写到现成变量中)
|
|
PayService <- AliPayStrategy: 支付调用完成
|
|
PayService -> AliPayStrategy: 进行支付调用成功后处理
|
|
AliPayStrategy --> ChannelOrderService: 保存通道支付订单
|
|
AliPayStrategy --> ChannelOrderService: 如果已经支付完成, 保存流水记录
|
|
PayService <- AliPayStrategy: 处理完成
|
|
PayService --> ClientNoticeService: 如果支付成功, 发送通知
|
|
Client <- PayService: 返回支付结果
|
|
|
|
@enduml
|