Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.14'

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 24
check-latest: true
Comment on lines 57 to 60

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update actions/setup-node to v4.

The actions/setup-node@v3 action version is outdated. According to the static analysis tool, the runner is too old to run on GitHub Actions.

🔎 Proposed fix
       - name: Setup Node
-        uses: actions/setup-node@v3
+        uses: actions/setup-node@v4
         with:
           node-version: 24
           check-latest: true

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 24
check-latest: true
uses: actions/setup-node@v4
with:
node-version: 24
check-latest: true
🧰 Tools
🪛 actionlint (1.7.9)

57-57: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
.github/workflows/ci.yml around lines 57 to 60: the workflow uses
actions/setup-node@v3 which is outdated; update the action reference to
actions/setup-node@v4 by replacing the uses line accordingly (keep the existing
with: keys like node-version: 24 and check-latest: true intact) so the runner
uses the current setup-node major version.


- name: Cache pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ frappe.ui.form.on("Razorpay Order", {
frm.add_web_link(
`https://dashboard.razorpay.com/app/orders/${frm.doc.order_id}?init_point=orders-table&init_page=Transactions.Orders`,
"View in Razorpay Dashboard"
)
);
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class RazorpayOrder(Document):
ref_dn: DF.DynamicLink | None
ref_dt: DF.Link | None
refund_id: DF.Data | None
status: DF.Literal["Pending", "Failed", "Paid", "Refund in Progress", "Refunded"]
status: DF.Literal[
"Pending", "Failed", "Paid", "Refund in Progress", "Refunded"
]
subscription: DF.Link | None
tax: DF.Currency
type: DF.Literal["Standalone", "Payment Link", "Subscription"]
Expand Down Expand Up @@ -131,10 +133,17 @@ def set_payment_details(self, payment_entity: dict | None = None):
frappe.errprint(payment_entity)

self.payment_id = payment_entity.get("id")
self.fee = convert_from_razorpay_money(payment_entity.get("fee", 0))
self.tax = convert_from_razorpay_money(payment_entity.get("tax", 0))

self.fee = convert_from_razorpay_money(
payment_entity.get("fee", 0) or 0
)
self.tax = convert_from_razorpay_money(
payment_entity.get("tax", 0) or 0
)
if payment_entity.get("base_currency"):
self.base_amount = convert_from_razorpay_money(payment_entity.get("base_amount", 0))
self.base_amount = convert_from_razorpay_money(
payment_entity.get("base_amount", 0) or 0
)
self.base_currency = payment_entity.get("base_currency")
self.method = payment_entity.get("method")
self.contact = payment_entity.get("contact")
Expand Down Expand Up @@ -169,7 +178,9 @@ def sync_status(self):

if order["status"] == "paid":
frappe.errprint(payments)
if not self.payment_id or (payments[-1]["status"] == "captured" and self.status != "Paid"):
if not self.payment_id or (
payments[-1]["status"] == "captured" and self.status != "Paid"
):
self.status = "Paid"
self.payment_id = payments[-1]["id"]
elif payments[-1]["status"] == "refunded":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
from frappe.model.document import Document
from frappe.utils.data import get_timestamp

from razorpay_frappe.utils import get_in_razorpay_money, get_razorpay_client, convert_from_razorpay_money
from razorpay_frappe.utils import (
convert_from_razorpay_money,
get_in_razorpay_money,
get_razorpay_client,
)


class RazorpayPaymentLink(Document):
Expand All @@ -27,7 +31,9 @@ class RazorpayPaymentLink(Document):
expire_by: DF.Date | None
id: DF.Data | None
short_url: DF.Data | None
status: DF.Literal["Created", "Partially Paid", "Expired", "Cancelled", "Paid"]
status: DF.Literal[
"Created", "Partially Paid", "Expired", "Cancelled", "Paid"
]
type: DF.Literal["Standard", "UPI"]
# end: auto-generated types

Expand Down Expand Up @@ -73,13 +79,18 @@ def fetch_latest_status(self):

def create_or_update_order(self, order_id: str):
client = get_razorpay_client()
order_already_exists = frappe.db.exists("Razorpay Order", {"order_id": order_id})
order_already_exists = frappe.db.exists(
"Razorpay Order", {"order_id": order_id}
)

if order_already_exists:
frappe.get_doc("Razorpay Order", {"order_id": order_id}).sync_status()
frappe.get_doc(
"Razorpay Order", {"order_id": order_id}
).sync_status()
else:
razorpay_order = client.order.fetch(order_id)
order_doc = frappe.get_doc(doctype="Razorpay Order",
order_doc = frappe.get_doc(
doctype="Razorpay Order",
order_id=order_id,
amount=convert_from_razorpay_money(razorpay_order["amount"]),
currency=razorpay_order["currency"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ class RazorpaySettings(Document):
# end: auto-generated types

pass


1 change: 0 additions & 1 deletion razorpay_frappe/webhook_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def process_standalone_order(self):
except frappe.DoesNotExistError:
frappe.log_error("Razorpay Order not found!")


@property
def is_standalone_order(self) -> bool:
order_id = self.get_payment_order_id()
Expand Down
Loading