pixelarraythirdparty 1.0.2__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pixelarraythirdparty/__init__.py +1 -1
- pixelarraythirdparty/order/order.py +52 -34
- {pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/METADATA +1 -1
- {pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/RECORD +7 -8
- pixelarraythirdparty/order/pay.py +0 -44
- {pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/WHEEL +0 -0
- {pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/licenses/LICENSE +0 -0
- {pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/top_level.txt +0 -0
pixelarraythirdparty/__init__.py
CHANGED
@@ -4,17 +4,13 @@ from pixelarraythirdparty.client import Client
|
|
4
4
|
class OrderManager(Client):
|
5
5
|
def create_order(
|
6
6
|
self,
|
7
|
-
product_name: str,
|
8
7
|
product_id: str,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
payment_channel: str,
|
8
|
+
body: str = None,
|
9
|
+
remark: str = None,
|
10
|
+
payment_channel: str = "WECHAT",
|
13
11
|
):
|
14
12
|
data = {
|
15
|
-
"product_name": product_name,
|
16
13
|
"product_id": product_id,
|
17
|
-
"amount": amount,
|
18
14
|
"body": body,
|
19
15
|
"remark": remark,
|
20
16
|
"payment_channel": payment_channel,
|
@@ -29,58 +25,42 @@ class OrderManager(Client):
|
|
29
25
|
page: int = 1,
|
30
26
|
page_size: int = 10,
|
31
27
|
payment_status: str = None,
|
32
|
-
|
28
|
+
out_trade_no: str = None,
|
33
29
|
):
|
34
30
|
params = {
|
35
31
|
"page": page,
|
36
32
|
"page_size": page_size,
|
37
33
|
"payment_status": payment_status,
|
38
|
-
"
|
34
|
+
"out_trade_no": out_trade_no,
|
39
35
|
}
|
40
36
|
data, success = self._request("GET", "/api/orders/list", params=params)
|
41
37
|
if not success:
|
42
38
|
return {}, False
|
43
39
|
return data, True
|
44
40
|
|
45
|
-
def get_order_detail(self,
|
46
|
-
data, success = self._request("GET", f"/api/orders/{
|
41
|
+
def get_order_detail(self, out_trade_no: str):
|
42
|
+
data, success = self._request("GET", f"/api/orders/{out_trade_no}")
|
47
43
|
if not success:
|
48
44
|
return {}, False
|
49
45
|
return data, True
|
50
46
|
|
51
|
-
def
|
47
|
+
def update_order_status(
|
52
48
|
self,
|
53
|
-
|
49
|
+
out_trade_no: str,
|
54
50
|
payment_status: str,
|
55
|
-
wx_order_no: str,
|
56
|
-
transaction_id: str,
|
57
|
-
openid: str,
|
58
|
-
trade_type: str,
|
59
|
-
bank_type: str,
|
60
|
-
fee_type: str,
|
61
|
-
is_subscribe: str,
|
62
|
-
time_end: str,
|
63
|
-
remark: str,
|
64
51
|
):
|
65
52
|
data = {
|
66
53
|
"payment_status": payment_status,
|
67
|
-
"wx_order_no": wx_order_no,
|
68
|
-
"transaction_id": transaction_id,
|
69
|
-
"openid": openid,
|
70
|
-
"trade_type": trade_type,
|
71
|
-
"bank_type": bank_type,
|
72
|
-
"fee_type": fee_type,
|
73
|
-
"is_subscribe": is_subscribe,
|
74
|
-
"time_end": time_end,
|
75
|
-
"remark": remark,
|
76
54
|
}
|
77
|
-
data, success = self._request(
|
55
|
+
data, success = self._request(
|
56
|
+
"PUT", f"/api/orders/{out_trade_no}/status", json=data
|
57
|
+
)
|
78
58
|
if not success:
|
79
59
|
return {}, False
|
80
60
|
return data, True
|
81
61
|
|
82
|
-
def delete_order(self,
|
83
|
-
data, success = self._request("DELETE", f"/api/orders/{
|
62
|
+
def delete_order(self, out_trade_no: str):
|
63
|
+
data, success = self._request("DELETE", f"/api/orders/{out_trade_no}")
|
84
64
|
if not success:
|
85
65
|
return {}, False
|
86
66
|
return data, True
|
@@ -90,3 +70,41 @@ class OrderManager(Client):
|
|
90
70
|
if not success:
|
91
71
|
return {}, False
|
92
72
|
return data, True
|
73
|
+
|
74
|
+
def generate_qr_code(
|
75
|
+
self,
|
76
|
+
out_trade_no: str,
|
77
|
+
payment_channel: str = "WECHAT",
|
78
|
+
):
|
79
|
+
if payment_channel == "WECHAT":
|
80
|
+
url = "/api/orders/wx_pay/generate_qr_code"
|
81
|
+
elif payment_channel == "ALIPAY":
|
82
|
+
url = "/api/orders/ali_pay/generate_qr_code"
|
83
|
+
else:
|
84
|
+
raise ValueError("Invalid payment channel")
|
85
|
+
data, success = self._request(
|
86
|
+
"POST",
|
87
|
+
url,
|
88
|
+
json={
|
89
|
+
"out_trade_no": out_trade_no,
|
90
|
+
},
|
91
|
+
)
|
92
|
+
if not success:
|
93
|
+
return {}, False
|
94
|
+
return data, True
|
95
|
+
|
96
|
+
def refund_order(self, out_trade_no: str, payment_channel: str = "WECHAT"):
|
97
|
+
if payment_channel == "WECHAT":
|
98
|
+
url = "/api/orders/wx_pay/refund"
|
99
|
+
elif payment_channel == "ALIPAY":
|
100
|
+
url = "/api/orders/ali_pay/refund"
|
101
|
+
else:
|
102
|
+
raise ValueError("Invalid payment channel")
|
103
|
+
data, success = self._request(
|
104
|
+
"POST",
|
105
|
+
url,
|
106
|
+
json={"out_trade_no": out_trade_no},
|
107
|
+
)
|
108
|
+
if not success:
|
109
|
+
return {}, False
|
110
|
+
return data, True
|
@@ -1,16 +1,15 @@
|
|
1
|
-
pixelarraythirdparty/__init__.py,sha256=
|
1
|
+
pixelarraythirdparty/__init__.py,sha256=TYuj96ZwZ4VXhB9Xn4KoEWpoJVsChUjzoWSRZONmC-U,458
|
2
2
|
pixelarraythirdparty/client.py,sha256=dJlIrMlr1M4AGHvaLw191uaPnQbQ12_BGx8DTDTPkZQ,802
|
3
3
|
pixelarraythirdparty/celery/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
pixelarraythirdparty/celery/celery.py,sha256=Oaa7pBztL-FM0X5NSCjjfZP80AUsnnme5Z3RxXIJsZg,1178
|
5
5
|
pixelarraythirdparty/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
pixelarraythirdparty/order/order.py,sha256=
|
7
|
-
pixelarraythirdparty/order/pay.py,sha256=Fq7HKeYS_jk9CWdPldXE5OzuHl66SHHQW4sYlG6yODM,1251
|
6
|
+
pixelarraythirdparty/order/order.py,sha256=kmJNAvfiXxhjOhRbD3JTl1saE8aetMZ0TFR9NjPsaIM,3208
|
8
7
|
pixelarraythirdparty/product/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
8
|
pixelarraythirdparty/product/product.py,sha256=eHU0VKal1QpJs6F4_VxLoBYeeqQ19elEogH2Qpw7IDo,3029
|
10
9
|
pixelarraythirdparty/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
10
|
pixelarraythirdparty/user/user.py,sha256=tbcFsrNEdWz4op7V_zJ5o8neBuI4ogl4dgHS-uSIAX0,2155
|
12
|
-
pixelarraythirdparty-1.0.
|
13
|
-
pixelarraythirdparty-1.0.
|
14
|
-
pixelarraythirdparty-1.0.
|
15
|
-
pixelarraythirdparty-1.0.
|
16
|
-
pixelarraythirdparty-1.0.
|
11
|
+
pixelarraythirdparty-1.0.3.dist-info/licenses/LICENSE,sha256=O-g1dUr0U50rSIvmWE9toiVkSgFpVt72_MHITbWvAqA,1067
|
12
|
+
pixelarraythirdparty-1.0.3.dist-info/METADATA,sha256=_BcKEA0W8joCfUZcvDqyKBkBXKGyWUwIDVI16boT7s4,993
|
13
|
+
pixelarraythirdparty-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
14
|
+
pixelarraythirdparty-1.0.3.dist-info/top_level.txt,sha256=dzG2Ut8j7noUqj_0ZQjcIDAeHYCh_9WtlxjAxtoyufo,21
|
15
|
+
pixelarraythirdparty-1.0.3.dist-info/RECORD,,
|
@@ -1,44 +0,0 @@
|
|
1
|
-
from pixelarraythirdparty.client import Client
|
2
|
-
|
3
|
-
|
4
|
-
class WeChatPayManager(Client):
|
5
|
-
def generate_qr_code(
|
6
|
-
self,
|
7
|
-
out_trade_no: str,
|
8
|
-
total_fee: int,
|
9
|
-
body: str,
|
10
|
-
product_name: str,
|
11
|
-
product_id: str,
|
12
|
-
):
|
13
|
-
data, success = self._request(
|
14
|
-
"POST",
|
15
|
-
"/api/wx_pay/generate_qr_code",
|
16
|
-
json={
|
17
|
-
"out_trade_no": out_trade_no,
|
18
|
-
"total_fee": total_fee,
|
19
|
-
"body": body,
|
20
|
-
"product_name": product_name,
|
21
|
-
"product_id": product_id,
|
22
|
-
},
|
23
|
-
)
|
24
|
-
if not success:
|
25
|
-
return {}, False
|
26
|
-
return data, True
|
27
|
-
|
28
|
-
def query_order(self, out_trade_no: str):
|
29
|
-
data, success = self._request(
|
30
|
-
"POST", "/api/wx_pay/query_order", json={"out_trade_no": out_trade_no}
|
31
|
-
)
|
32
|
-
if not success:
|
33
|
-
return {}, False
|
34
|
-
return data, True
|
35
|
-
|
36
|
-
def refund(self, out_trade_no: str, total_fee: int):
|
37
|
-
data, success = self._request(
|
38
|
-
"POST",
|
39
|
-
"/api/wx_pay/refund",
|
40
|
-
json={"out_trade_no": out_trade_no, "total_fee": total_fee},
|
41
|
-
)
|
42
|
-
if not success:
|
43
|
-
return {}, False
|
44
|
-
return data, True
|
File without changes
|
{pixelarraythirdparty-1.0.2.dist-info → pixelarraythirdparty-1.0.3.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|