olimart/koopon_now — Issue #25: Payments
Author: olimart
Created: 2012-02-13 05:25:03+00:00
State: open
Labels: P2

Need you to finalize and simplify purchases method. We have 3 scenarios:

* If user has credit?
* If credit > total_price
* No gateway needed
* Withdraw total_price from user.profile.wallet
* Create PurchaseTransaction (log wallet before and wallet after in message)
* If credit < total_price
* Gateway needed
* if response.success
* Withdraw total_price from user.profile.wallet
* Create PurchaseTransaction (log wallet before and wallet after in message)
* else no purchase and log error
* else
* Gateway needed
* if response.success
* Withdraw total_price from user.profile.wallet
* Create PurchaseTransaction (log wallet before and wallet after in message)
* else no purchase and log error