aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/buy_vps_server.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/python/buy_vps_server.py b/python/buy_vps_server.py
index 2803e32..44ae786 100644
--- a/python/buy_vps_server.py
+++ b/python/buy_vps_server.py
@@ -48,7 +48,16 @@ order = client.post('/order/cart/{}/checkout'.format(cart_id),
48order_id = order["orderId"] 48order_id = order["orderId"]
49print(order_id) 49print(order_id)
50 50
51# Suite à tester : 51payment_mean = client.get('/me/order/{}/availableRegisteredPaymentMean'.format(order_id))[0]['paymentMean']
52# /me/order/{orderId}/availableRegisteredPaymentMean 52payment_mean_id = client.get('/me/paymentMean/{}'.format(payment_mean))[0]
53# /me/paymentMean ? /me/order/{orderId}/debt/pay ?
54 53
54payment_mean_status = client.get('/me/paymentMean/{}/{}'.format(payment_mean, payment_mean_id))
55
56if payment_mean_status["state"] != "valid":
57 raise "Bouh"
58
59paid_order = client.post('/me/order/{}/payWithRegisteredPaymentMean'.format(order_id),
60 paymentMean=payment_mean, paymentMeanId=payment_mean_id)
61
62if 'paymentDate' in paid_order:
63 print("successful")