mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-30 02:14:48 +00:00
chore: move older code into v1 gateway file
This commit is contained in:
@@ -109,3 +109,11 @@ def v1_gateway_before_submit(self, payment_gateway):
|
|||||||
if not (self.mute_email or self.flags.mute_email):
|
if not (self.mute_email or self.flags.mute_email):
|
||||||
self.send_email()
|
self.send_email()
|
||||||
self.make_communication_entry()
|
self.make_communication_entry()
|
||||||
|
|
||||||
|
|
||||||
|
def v1_create_subscription(payment_provider, gateway_controller, data):
|
||||||
|
if payment_provider == "stripe":
|
||||||
|
with payment_app_import_guard():
|
||||||
|
from payments.payment_gateways.stripe_integration import create_stripe_subscription
|
||||||
|
|
||||||
|
return create_stripe_subscription(gateway_controller, data)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from erpnext.accounts.party import get_party_account, get_party_bank_account
|
|||||||
from erpnext.accounts.utils import get_account_currency, get_currency_precision
|
from erpnext.accounts.utils import get_account_currency, get_currency_precision
|
||||||
from erpnext.utilities import payment_app_import_guard
|
from erpnext.utilities import payment_app_import_guard
|
||||||
|
|
||||||
from .payment_gateway_v1 import v1_gateway_before_submit
|
from .payment_gateway_v1 import v1_create_subscription, v1_gateway_before_submit
|
||||||
|
|
||||||
|
|
||||||
class PaymentRequest(Document):
|
class PaymentRequest(Document):
|
||||||
@@ -327,12 +327,8 @@ class PaymentRequest(Document):
|
|||||||
)
|
)
|
||||||
comm.insert(ignore_permissions=True)
|
comm.insert(ignore_permissions=True)
|
||||||
|
|
||||||
def create_subscription(self, payment_provider, gateway_controller, data):
|
def create_subscription(self, *args, **kwargs):
|
||||||
if payment_provider == "stripe":
|
return v1_create_subscription(*args, **kwargs)
|
||||||
with payment_app_import_guard():
|
|
||||||
from payments.payment_gateways.stripe_integration import create_stripe_subscription
|
|
||||||
|
|
||||||
return create_stripe_subscription(gateway_controller, data)
|
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user