Skip to content
12 changes: 12 additions & 0 deletions payments/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# include js, css files in header of desk.html
# app_include_css = "/assets/pay/css/pay.css"
# app_include_js = "/assets/pay/js/pay.js"
app_include_js = [
# ...existing entries...
"payments/public/js/ccavenue_session_handler.js"
]

# include js, css files in header of web template
# web_include_css = "/assets/pay/css/pay.css"
Expand Down Expand Up @@ -107,6 +111,14 @@
# "on_trash": "method"
# }
# }
doc_events = {
"Payment Request": {
"on_payment_authorized":"payments.utils.ivyliving_methods.handle_payment_authorization_payment_request"
},
"Customer":{
"on_payment_authorized":"payments.utils.ivyliving_methods.handle_payment_authorization_customer"
}
}

# Scheduled Tasks
# ---------------
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright (c) 2025, Frappe Technologies and contributors
// For license information, please see license.txt

// frappe.ui.form.on("CCAvenue Merchant", {
// refresh(frm) {

// },
// });
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:{merchant_name}",
"creation": "2025-04-14 14:53:53.832399",
"doctype": "DocType",
"engine": "InnoDB",
"field_order": [
"merchant_name",
"merchant_id",
"access_code",
"encryption_key",
"enviroment",
"column_break_itky",
"bank_account",
"debtors_account",
"company"
],
"fields": [
{
"fieldname": "merchant_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Merchant Name",
"reqd": 1
},
{
"fieldname": "merchant_id",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Merchant ID",
"reqd": 1
},
{
"fieldname": "access_code",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Access Code",
"reqd": 1
},
{
"fieldname": "encryption_key",
"fieldtype": "Password",
"in_list_view": 1,
"label": "Encryption Key",
"reqd": 1
},
{
"fieldname": "enviroment",
"fieldtype": "Select",
"label": "Enviroment",
"options": "Sandbox\nProduction",
"reqd": 1
},
{
"description": "If empty it will select the Debters account of the company from student records. Give only prefix, the company will be fetched from the company field.",
"fieldname": "debtors_account",
"fieldtype": "Data",
"label": "Debtors Account"
},
{
"description": "If empty it will select the CCAvenue account of the company from student records. Give only prefix, the company will be fetched from the company field.",
"fieldname": "bank_account",
"fieldtype": "Data",
"label": "Bank Account"
},
{
"description": "If empty it will select the default students company from the student records.",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"options": "Company"
},
{
"fieldname": "column_break_itky",
"fieldtype": "Column Break"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-04-14 15:22:03.307321",
"modified_by": "Administrator",
"module": "Payment Gateways",
"name": "CCAvenue Merchant",
"naming_rule": "Expression",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "merchant_name"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025, Frappe Technologies and contributors
# For license information, please see license.txt

# import frappe
from frappe.model.document import Document


class CCAvenueMerchant(Document):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2025, Frappe Technologies and Contributors
# See license.txt

# import frappe
from frappe.tests.utils import FrappeTestCase


class TestCCAvenueMerchant(FrappeTestCase):
pass
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) 2024, Frappe Technologies and contributors
// For license information, please see license.txt

frappe.ui.form.on("CCAvenue Settings", {
refresh: function (frm) {
frm.add_custom_button(__("Clear"), function () {
frm.call({
doc: frm.doc,
method: "clear",
callback: function (r) {
frm.refresh();
},
});
});

frm.add_custom_button(__("Test Connection"), function () {
frappe.call({
method: "payments.payment_gateways.doctype.ccavenue_settings.ccavenue_utils.test_connection",
args: {
merchant_id: frm.doc.merchant_id,
access_code: frm.doc.access_code,
encryption_key: frm.doc.encryption_key,
environment: frm.doc.environment
},
callback: function (r) {
if (r.message && r.message.success) {
frappe.msgprint(__('Connection Successful'));
} else {
frappe.msgprint(__('Connection Failed: ') + (r.message ? r.message.error : "Unknown error"));
}
}
});
});
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"actions": [],
"creation": "2024-06-04 00:00:00.000000",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"credentials_section",
"merchant_id",
"access_code",
"encryption_key",
"environment",
"integration_settings_section",
"redirect_to",
"api_header_section",
"header_img"
],
"fields": [
{
"fieldname": "credentials_section",
"fieldtype": "Section Break",
"label": "Credentials"
},
{
"fieldname": "merchant_id",
"fieldtype": "Data",
"label": "Merchant ID",
"reqd": 1
},
{
"fieldname": "access_code",
"fieldtype": "Data",
"label": "Access Code",
"reqd": 1
},
{
"fieldname": "encryption_key",
"fieldtype": "Password",
"label": "Encryption Key",
"reqd": 1
},
{
"default": "Sandbox",
"fieldname": "environment",
"fieldtype": "Select",
"label": "Environment",
"options": "Sandbox\nProduction",
"reqd": 1
},
{
"fieldname": "integration_settings_section",
"fieldtype": "Section Break",
"label": "Integration Settings"
},
{
"description": "Mention transaction completion page URL",
"fieldname": "redirect_to",
"fieldtype": "Data",
"label": "Redirect To"
},
{
"fieldname": "api_header_section",
"fieldtype": "Section Break",
"label": "API Header"
},
{
"fieldname": "header_img",
"fieldtype": "Attach Image",
"label": "Header Image"
}
],
"issingle": 1,
"links": [],
"modified": "2024-06-04 00:00:00.000000",
"modified_by": "Administrator",
"module": "Payment Gateways",
"name": "CCAvenue Settings",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"print": 1,
"read": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}
Loading