-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathpay_response.py
58 lines (48 loc) · 1.3 KB
/
pay_response.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = 'adison'
# @Time : 2018/12/18
"""
支付返回业务信息,主要用于支付查询
"""
class PayResponse(object):
def __init__(self, builder):
self.data = {}
for key, value in builder.__dict__.items():
setattr(self, key, value)
self.data[key] = value
class Builder(object):
def out_trade_no(self, value):
"""
商户订单号
:param value:
:return:
"""
self.out_trade_no = value
return self
def trade_no(self, value):
"""
平台订单号
:param value:
:return:
"""
self.trade_no = value
return self
def refund_amount(self, value):
"""
退款金额
:param value:
:return:
"""
self.refund_amount = value
return self
def out_request_no(self, value):
"""
请求退款接口时,传入的退款请求号(支付宝)
:param value:
:return:
"""
self.out_request_no = value
return self
def build(self):
return PayResponse(self)