Permalink
Browse files

Use attribute gateway instead of *_gateway to make the usage uniform.

  • Loading branch information...
1 parent 6d5887b commit 6e56ff34fa9d2e0320a06e66c79ae2205e30a271 @theju theju committed Jan 27, 2012
@@ -9,7 +9,7 @@ class SamuraiIntegration(Integration):
def __init__(self):
super(SamuraiIntegration, self).__init__()
self.merchant_key = settings.SAMURAI_MERCHANT_KEY
- self.samurai_gateway = get_gateway("samurai")
+ self.gateway = get_gateway("samurai")
def generate_form(self):
initial_data = self.fields
@@ -7,7 +7,7 @@
class StripeIntegration(Integration):
def __init__(self):
super(StripeIntegration, self).__init__()
- self.stripe_gateway = get_gateway("stripe")
+ self.gateway = get_gateway("stripe")
self.publishable_key = settings.STRIPE_PUBLISHABLE_KEY
def generate_form(self):
@@ -11,5 +11,5 @@
class SamuraiExampleIntegration(SamuraiIntegration):
@csrf_exempt
def transaction(self, request):
- resp = self.samurai_gateway.purchase(1, request.POST["payment_method_token"])
+ resp = self.gateway.purchase(1, request.POST["payment_method_token"])
return HttpResponse(resp["response"].to_json())
@@ -4,6 +4,6 @@
class StripeExampleIntegration(StripeIntegration):
def transaction(self, request):
- resp = self.stripe_gateway.purchase(100, request.POST["stripeToken"])
+ resp = self.gateway.purchase(100, request.POST["stripeToken"])
return HttpResponseRedirect("%s?status=%s" %(reverse("app_offsite_stripe"),
resp["status"]))

0 comments on commit 6e56ff3

Please sign in to comment.