Browse Source

[fix] [test] for notification

pull/2/head
Rushabh Mehta 7 years ago
parent
commit
1aa73ddd46
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      payments/payment_gateways/doctype/stripe_settings/stripe_settings.py

+ 2
- 1
payments/payment_gateways/doctype/stripe_settings/stripe_settings.py View File

@@ -9,7 +9,6 @@ from frappe import _
from six.moves.urllib.parse import urlencode
from frappe.utils import get_url, call_hook_method, cint, flt
from frappe.integrations.utils import make_get_request, make_post_request, create_request_log, create_payment_gateway
import stripe

class StripeSettings(Document):
supported_currencies = [
@@ -58,6 +57,7 @@ class StripeSettings(Document):
return get_url("./integrations/stripe_checkout?{0}".format(urlencode(kwargs)))

def create_request(self, data):
import stripe
self.data = frappe._dict(data)
stripe.api_key = self.get_password(fieldname="secret_key", raise_exception=False)
stripe.default_http_client = stripe.http_client.RequestsClient()
@@ -74,6 +74,7 @@ class StripeSettings(Document):
}

def create_charge_on_stripe(self):
import stripe
try:
charge = stripe.Charge.create(amount=cint(flt(self.data.amount)*100), currency=self.data.currency, source=self.data.stripe_token_id, description=self.data.description)



Loading…
Cancel
Save