diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/buy_vps_server.py | 15 |
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), | |||
48 | order_id = order["orderId"] | 48 | order_id = order["orderId"] |
49 | print(order_id) | 49 | print(order_id) |
50 | 50 | ||
51 | # Suite à tester : | 51 | payment_mean = client.get('/me/order/{}/availableRegisteredPaymentMean'.format(order_id))[0]['paymentMean'] |
52 | # /me/order/{orderId}/availableRegisteredPaymentMean | 52 | payment_mean_id = client.get('/me/paymentMean/{}'.format(payment_mean))[0] |
53 | # /me/paymentMean ? /me/order/{orderId}/debt/pay ? | ||
54 | 53 | ||
54 | payment_mean_status = client.get('/me/paymentMean/{}/{}'.format(payment_mean, payment_mean_id)) | ||
55 | |||
56 | if payment_mean_status["state"] != "valid": | ||
57 | raise "Bouh" | ||
58 | |||
59 | paid_order = client.post('/me/order/{}/payWithRegisteredPaymentMean'.format(order_id), | ||
60 | paymentMean=payment_mean, paymentMeanId=payment_mean_id) | ||
61 | |||
62 | if 'paymentDate' in paid_order: | ||
63 | print("successful") | ||