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