Spaces:
Sleeping
Sleeping
Print Payment Method Options
Browse files
main.py
CHANGED
|
@@ -49,26 +49,35 @@ async def webhook_received(request: Request, stripe_signature: str = Header(None
|
|
| 49 |
|
| 50 |
if event_type == 'checkout.session.async_payment_succeeded':
|
| 51 |
print("Pago asíncrono completado.")
|
| 52 |
-
|
| 53 |
-
if event_type == '
|
| 54 |
-
print("
|
| 55 |
-
#print(event_data)
|
| 56 |
print("Status:")
|
| 57 |
-
print(event_data['status'])
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
print("
|
| 61 |
-
print(event_data['
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
else:
|
| 74 |
print(f'unhandled event: {event_type}')
|
|
|
|
| 49 |
|
| 50 |
if event_type == 'checkout.session.async_payment_succeeded':
|
| 51 |
print("Pago asíncrono completado.")
|
| 52 |
+
|
| 53 |
+
if event_type == 'checkout.session.completed':
|
| 54 |
+
print("Checkout Session completado.")
|
|
|
|
| 55 |
print("Status:")
|
| 56 |
+
print(event_data['status'])
|
| 57 |
+
print("Payment Method Options:")
|
| 58 |
+
print(event_data['payment_method_options'])
|
| 59 |
+
print("Cantidad de elementos:")
|
| 60 |
+
print(len(event_data['payment_method_options']))
|
| 61 |
+
time.sleep(1)
|
| 62 |
+
|
| 63 |
+
# if event_type == 'payment_intent.succeeded':
|
| 64 |
+
# print("Pago realizado...")
|
| 65 |
+
# #print(event_data)
|
| 66 |
+
#
|
| 67 |
+
# # print("Nombre Cliente:")
|
| 68 |
+
# # print(event_data['customer_details']['name'])
|
| 69 |
+
# print("Metadata:")
|
| 70 |
+
# print(event_data['metadata'])
|
| 71 |
+
# #cus_id = event_data['metadata']['stripe_customer_id']
|
| 72 |
+
# # print("Metadata Cusid:")
|
| 73 |
+
# # print(cus_id)
|
| 74 |
+
# # imagenes = event_data['metadata']['imagenes']
|
| 75 |
+
# # print("Imágenes:")
|
| 76 |
+
# # print(imagenes)
|
| 77 |
+
# cus_id = event_data['customer']
|
| 78 |
+
# # print("Customer directo:")
|
| 79 |
+
# # print(cus_id)
|
| 80 |
+
# # herramientas.registrar_evento(cus_id, int(imagenes))
|
| 81 |
|
| 82 |
else:
|
| 83 |
print(f'unhandled event: {event_type}')
|