Skip to content

Commit

Permalink
Merge pull request #304 from yrestom/develop
Browse files Browse the repository at this point in the history
Version: 4.3.1
  • Loading branch information
yrestom authored Apr 26, 2023
2 parents 1b6d9c8 + 791fe6b commit 2f7d057
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion posawesome/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe

__version__ = "4.3.0"
__version__ = "4.3.1"


def console(*data):
Expand Down
9 changes: 3 additions & 6 deletions posawesome/posawesome/api/m_pesa.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_token(app_key, app_secret, base_url):


@frappe.whitelist(allow_guest=True)
def confirmation(**kwargs):
def validation(**kwargs):
try:
args = frappe._dict(kwargs)
doc = frappe.new_doc("Mpesa Payment Register")
Expand All @@ -35,20 +35,17 @@ def confirmation(**kwargs):
doc.middlename = args.get("MiddleName")
doc.lastname = args.get("LastName")
doc.insert(ignore_permissions=True)
frappe.log_error("confirmation" + " " + str(args), "confirmation")
frappe.db.commit()
context = {"ResultCode": 0, "ResultDesc": "Accepted"}
return dict(context)
except Exception as e:
frappe.log_error(frappe.get_traceback(), str(e))
frappe.log_error(frappe.get_traceback(), str(e)[:140])
context = {"ResultCode": 1, "ResultDesc": "Rejected"}
return dict(context)


@frappe.whitelist(allow_guest=True)
def validation(**kwargs):
args = frappe._dict(kwargs)
frappe.log_error("validation" + " " + str(args), "validation")
def confirmation(**kwargs):
context = {"ResultCode": 0, "ResultDesc": "Accepted"}
return dict(context)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def validate(self):
payload = {
"ShortCode": business_shortcode,
"ResponseType": "Completed",
"ConfirmationURL": validation_url,
"ValidationURL": confirmation_url,
"ConfirmationURL": confirmation_url,
"ValidationURL": validation_url,
}
headers = {
"Authorization": "Bearer {0}".format(token),
Expand Down

0 comments on commit 2f7d057

Please sign in to comment.