美文网首页
PlantUML练习系列----APP微信支付流程

PlantUML练习系列----APP微信支付流程

作者: kuwork | 来源:发表于2017-02-16 10:01 被阅读0次
    APP微信支付流程
    @startuml
    skinparam backgroundColor #EEEBDC
    
    skinparam sequence {
        ArrowColor DeepSkyBlue
        ActorBorderColor DeepSkyBlue
        LifeLineBorderColor blue
        LifeLineBackgroundColor #A9DCDF
    
      ParticipantBorderColor DeepSkyBlue
      ParticipantBackgroundColor DodgerBlue
      ParticipantFontName Impact
      ParticipantFontSize 17
      ParticipantFontColor #A9DCDF
    
        ActorBackgroundColor aqua
        ActorFontColor DeepSkyBlue
        ActorFontSize 17
        ActorFontName Aapex
    }
    
    title "登录过程"
    
    participant user
    
    
    actor "用户" as user
    participant "微信客户端" as wx
    participant "APP客户端" as app
    participant "商户后台系统" as A
    participant "微信支付系统" as D
    
    autonumber
    user->app:打开APP客户端
    activate user
    activate app #FF0000
    app->app:选择商品下单
    activate app #FF0000
    deactivate app
    app->A:请求生成支付订单
    activate A #FF0000
    A->A:生成带签名的客户端支付信息
    activate A #FF0000
    deactivate A
    A->D:调用统一下单API
    activate D
    D->D:生成预付单
    activate D
    deactivate D
    D-->A:返回预付单信息(prepay_id)
    deactivate D
    
    A-->app:返回信息(prepay_id,sign等)
    deactivate A
    deactivate app
    
    user->app:用户确认支付
    activate app #FF0000
    app->wx:支付参数调用SDK调起微信支付
    activate wx
    wx->D:发起微信支付请求
    activate D
    D->D:验证支付参数、APP支付权限等
    activate D
    deactivate D
    D-->wx:返回需要的支付授权
    deactivate D
    deactivate wx
    deactivate app
    deactivate D
    
    user->wx:用户确认支付,输入密码
    activate wx
    wx->D:提交支付授权
    activate D
    D->D:验证授权,完成支付交易
    activate D
    deactivate D
    alt 并行处理
    D-->wx:返回支付结果,发送微信消息提示
    D->A:异步通知商户支付结果
    activate A #FF0000
    A->A:接受和保存支付通知
    activate A #FF0000
    deactivate A
    A-->D:返回告知已成功接受处理
    deactivate A
    
    deactivate D
    end
    
    wx->app:将支付状态通过商户APP已经实现的回调结构执行回调
    activate app #FF0000
    app->A:后台查询实际支付结果
    activate A #FF0000
    alt 未收到支付通知
    A->D:调用微信查询API查询支付结果
    activate D
    D-->A:返回支付结果
    deactivate D
    end
    A-->app:返回支付结果
    deactivate A
    
    
    app-->user:展示支付结果
    deactivate app
    deactivate wx
    deactivate user
    deactivate app
    
    app->app:商户发货
    activate app #FF0000
    activate app #FF0000
    deactivate app
    deactivate app
    
    
    
    
    @enduml
    
    

    相关文章

      网友评论

          本文标题:PlantUML练习系列----APP微信支付流程

          本文链接:https://www.haomeiwen.com/subject/yavcwttx.html