aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2017-12-18 14:42:42 +0100
committerIsmaël Bouya <ismael.bouya@normalesup.org>2017-12-18 14:42:42 +0100
commitef18bb0b9facc2d85db138dd65720c14a33953c5 (patch)
tree7c3fb4401a5335c144f120aedfc19bac25e70fb0 /python
parent8c16250cf921bac3198e8917a38a90297de77c3f (diff)
downloadPuppet-ef18bb0b9facc2d85db138dd65720c14a33953c5.tar.gz
Puppet-ef18bb0b9facc2d85db138dd65720c14a33953c5.tar.zst
Puppet-ef18bb0b9facc2d85db138dd65720c14a33953c5.zip
Finish payment process for buying vps server
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")