emile 1 year ago
parent 813b9db77f
commit de0c2509cf

@ -3,6 +3,7 @@ from django.contrib.auth.decorators import login_required
from django.http import JsonResponse from django.http import JsonResponse
import requests import requests
from .decorators import * from .decorators import *
import uuid
# Create your views here. # Create your views here.
@customer_login_required @customer_login_required
@ -44,6 +45,8 @@ def initiate_checkout(request):
merchant_id = "TEST06127800" merchant_id = "TEST06127800"
merchant_name = "Ositcom Sal" merchant_name = "Ositcom Sal"
order_id = str(uuid.uuid4())[:8]
# Data for Initiate Checkout operation # Data for Initiate Checkout operation
data = { data = {
"apiOperation": "INITIATE_CHECKOUT", "apiOperation": "INITIATE_CHECKOUT",
@ -52,7 +55,7 @@ def initiate_checkout(request):
"merchant": merchant_id, "merchant": merchant_id,
"interaction.operation": "PURCHASE", "interaction.operation": "PURCHASE",
"interaction.merchant.name": merchant_name, "interaction.merchant.name": merchant_name,
"order.id": "123", "order.id": order_id,
"order.amount": "100.00", "order.amount": "100.00",
"order.currency": "USD", "order.currency": "USD",
"order.description": "description_of_order" "order.description": "description_of_order"

Loading…
Cancel
Save