Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1009 from uzairr/uzairr/ECOM-6155
Browse files Browse the repository at this point in the history
Adding logs for payment processors
  • Loading branch information
Qubad786 authored Nov 18, 2016
2 parents 066a764 + bc18caf commit 8ae9bd8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ecommerce/extensions/api/v2/views/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CheckoutView(APIView):

def post(self, request):
basket_id = request.data['basket_id']
payment_processor = request.data['payment_processor']
payment_processor_name = request.data['payment_processor']

# Get the basket, and make sure it belongs to the current user.
try:
Expand All @@ -38,11 +38,13 @@ def post(self, request):

# Return the payment info
try:
payment_processor = get_processor_class_by_name(payment_processor)(request.site)
payment_processor = get_processor_class_by_name(payment_processor_name)(request.site)
except ProcessorNotFoundError:
logger.exception('Failed to get payment processor [%s].', payment_processor)
logger.exception('Failed to get payment processor [%s]. basket id: [%s]. price: [%s]',
payment_processor_name, basket_id, basket.total_excl_tax)

return HttpResponseBadRequest(
'Payment processor [{}] not found.'.format(payment_processor)
'Payment processor [{}] not found.'.format(payment_processor_name)
)

parameters = payment_processor.get_transaction_parameters(basket, request=request)
Expand Down

0 comments on commit 8ae9bd8

Please sign in to comment.