Hi people,
I am writing a Satchmo payment module, where the mode of payment is
"prepayment" via mobile phone money transfer, and then "verification" of the
payment via the payment module.
How this works is:
1. The customer gets the order total from the Satchmo checkout page.
2. She transfers the amount by mobile money transfer (via the M-PESA [1],
Zap, or yuCash [2] services) to a certain phone number.
3. She receives a transaction ID from the mobile money service, and enters
it into the payment module page.
4. This transaction ID is sent by the payment module, to a third party
service [3], for verification.
5. The payment module receives confirmation of the amount actually
transfered for the transaction ID, and updates the OrderPayment in Satchmo,
with this amount.
6. If the transfered amount is equal to, or more than the order total, the
customer is sent to the success page.
7. But if the transfered amount is less that the order total, she is sent
back to the balance page: </checkout/balance/{ORDER_ID}/>, to make an
additional payment to offset the balance.
So, my problem is that, when the customer chooses my payment module, to make
the additional payment (from step 7 above), and is forwarded to my module's
page, I get the following error:
Traceback (most recent call last):
>
> File
> "/home/user/webapps/django/lib/python2.6/django/core/handlers/base.py", line
> 100, in get_response
> response = callback(request, *callback_args, **callback_kwargs)
>
> File
> "/home/user/webapps/django/lib/python2.6/satchmo_payment_modules/ipay/views.py",
> line 25, in pay_ship_info
> return payship.credit_pay_ship_info(request, ipay,
> template='shop/checkout/ipay/pay_ship.html')
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/views/payship.py",
> line 188, in credit_pay_ship_info
> return base_pay_ship_info(request, payment_module,
> credit_pay_ship_process_form, template)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/views/payship.py",
> line 179, in base_pay_ship_info
> results = form_handler(request, contact, working_cart, payment_module)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/views/payship.py",
> line 74, in credit_pay_ship_process_form
> form.save(request, working_cart, contact, payment_module, data=data)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/forms.py",
> line 397, in save
> self.order = get_or_create_order(request, cart, contact, data)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/utils.py",
> line 44, in get_or_create_order
> shipping=shipping, discount=discount, notes=notes, update=update)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/utils.py",
> line 78, in pay_ship_save
> update_orderitems(new_order, cart, update=update)
>
> File
> "/home/user/webapps/django/lib/python2.6/Satchmo-0.9.2-py2.6.egg/payment/utils.py",
> line 132, in update_orderitems
> new_order.site = cart.site
>
> AttributeError: 'OrderCart' object has no attribute 'site'
>
Looking at the the OrderCart class definition, it indeed has no attribute
"site". And I do not know where this would have been added, within the
Satchmo framework.
Also, looking at satchmo_store.shop.models.CartManager.from_request (where I
think this OrderCart originates), it looks like we could either get a Cart,
or an OrderCart. But OrderCart does not have the attribute 'site' (unlike
Cart), and I do not see it added anywhere.
Is this a bug in Satchmo? Should I create an issue for this?
Regards,
Joseph.
[1] <http://safaricom.co.ke/index.php?id=250> and <
http://en.wikipedia.org/wiki/M-Pesa>.
[2] <http://yu.co.ke/yucash>.
[3] iPay: <http://intrepidkenya.com/i-pay-mobile-transaction-processing.html
>.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.