Browse Source

Stripe corrections (#5700)

pull/2/head
Charles-Henri Decultot 7 years ago
committed by Rushabh Mehta
parent
commit
1b4b6737ee
3 changed files with 6 additions and 6 deletions
  1. +3
    -3
      payments/payment_gateways/doctype/stripe_settings/stripe_settings.py
  2. +1
    -1
      payments/templates/includes/stripe_checkout.js
  3. +2
    -2
      payments/templates/pages/stripe_checkout.py

+ 3
- 3
payments/payment_gateways/doctype/stripe_settings/stripe_settings.py View File

@@ -126,7 +126,7 @@ class StripeSettings(Document):
"status": status
}

def get_gateway_controller(doc):
payment_request = frappe.get_doc("Payment Request", doc)
gateway_controller = frappe.db.get_value("Payment Gateway", payment_request.payment_gateway, "gateway_controller")
def get_gateway_controller(doctype, docname):
reference_doc = frappe.get_doc(doctype, docname)
gateway_controller = frappe.db.get_value("Payment Gateway", reference_doc.payment_gateway, "gateway_controller")
return gateway_controller

+ 1
- 1
payments/templates/includes/stripe_checkout.js View File

@@ -59,7 +59,7 @@ function setOutcome(result) {
});

} else if (result.error) {
$('.error').html() = result.error.message;
$('.error').html(result.error.message);
$('.error').show()
}
}


+ 2
- 2
payments/templates/pages/stripe_checkout.py View File

@@ -21,7 +21,7 @@ def get_context(context):
for key in expected_keys:
context[key] = frappe.form_dict[key]

gateway_controller = get_gateway_controller(context.reference_docname)
gateway_controller = get_gateway_controller(context.reference_doctype, context.reference_docname)
context.publishable_key = get_api_key(context.reference_docname, gateway_controller)
context.image = get_header_image(context.reference_docname, gateway_controller)

@@ -59,7 +59,7 @@ def make_payment(stripe_token_id, data, reference_doctype=None, reference_docnam
"stripe_token_id": stripe_token_id
})

gateway_controller = get_gateway_controller(reference_docname)
gateway_controller = get_gateway_controller(reference_doctype,reference_docname)

if frappe.db.get_value(reference_doctype, reference_docname, 'is_a_subscription'):
reference = frappe.get_doc(reference_doctype, reference_docname)


Loading…
Cancel
Save