Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from Utomik/payment_denied
Browse files Browse the repository at this point in the history
Payment declined / delete subscription
  • Loading branch information
yorinasub17 committed May 12, 2016
2 parents a8d9aa6 + fd928c0 commit 288db64
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mocurly/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ def create(self, create_info, format=BaseRecurlyEndpoint.XML):
create_info['transaction_error'] = transaction_error
transaction_xml = super(TransactionsEndpoint, self).create(create_info, format)
error_xml = serialize('transaction_error.xml', 'transaction_error', transaction_error)
if create_info.get('subscription', False):
subscriptions_backend.delete_object(create_info['subscription'])
raise ResponseError(422, '<errors>{0}{1}</errors>'.format(error_xml, transaction_xml))

# Every new transaction creates a new invoice
Expand Down

0 comments on commit 288db64

Please sign in to comment.