Review corrections
This commit is contained in:
parent
5a2ee41af3
commit
cde1f08af6
@ -46,7 +46,6 @@ class PaymentRequest(Document):
|
|||||||
frappe.throw(_('The payment gateway account in plan {0} is different from the payment gateway account in this payment request'.format(plan.name)))
|
frappe.throw(_('The payment gateway account in plan {0} is different from the payment gateway account in this payment request'.format(plan.name)))
|
||||||
|
|
||||||
rate = plan.get_plan_rate()
|
rate = plan.get_plan_rate()
|
||||||
frappe.log_error(rate)
|
|
||||||
|
|
||||||
amount += rate
|
amount += rate
|
||||||
|
|
||||||
@ -261,7 +260,7 @@ class PaymentRequest(Document):
|
|||||||
|
|
||||||
def get_subscription_details(self):
|
def get_subscription_details(self):
|
||||||
if self.reference_doctype == "Sales Invoice":
|
if self.reference_doctype == "Sales Invoice":
|
||||||
subscriptions = frappe.db.sql("""SELECT parent as sub_name FROM `tabSubscription Invoice` WHERE invoice='{0}'""".format(self.reference_name), as_dict=1)
|
subscriptions = frappe.db.sql("""SELECT parent as sub_name FROM `tabSubscription Invoice` WHERE invoice=%s""", self.reference_name, as_dict=1)
|
||||||
self.subscription_plans = []
|
self.subscription_plans = []
|
||||||
for subscription in subscriptions:
|
for subscription in subscriptions:
|
||||||
plans = frappe.get_doc("Subscription", subscription.sub_name).plans
|
plans = frappe.get_doc("Subscription", subscription.sub_name).plans
|
||||||
|
@ -34,9 +34,6 @@ def create_subscription_on_stripe(stripe_settings):
|
|||||||
plan = frappe.db.get_value("Subscription Plan", payment_plan.plan, "payment_plan_id")
|
plan = frappe.db.get_value("Subscription Plan", payment_plan.plan, "payment_plan_id")
|
||||||
items.append({"plan": plan, "quantity": payment_plan.qty})
|
items.append({"plan": plan, "quantity": payment_plan.qty})
|
||||||
|
|
||||||
frappe.log_error(items, 'Items')
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
customer = stripe.Customer.create(description=stripe_settings.data.payer_name, email=stripe_settings.data.payer_email, source=stripe_settings.data.stripe_token_id)
|
customer = stripe.Customer.create(description=stripe_settings.data.payer_name, email=stripe_settings.data.payer_email, source=stripe_settings.data.stripe_token_id)
|
||||||
subscription = stripe.Subscription.create(customer=customer, items=items)
|
subscription = stripe.Subscription.create(customer=customer, items=items)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user