Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when i try to paid with alternate method #84

Open
xt0ph opened this issue Jan 11, 2015 · 2 comments
Open

Error when i try to paid with alternate method #84

xt0ph opened this issue Jan 11, 2015 · 2 comments

Comments

@xt0ph
Copy link

xt0ph commented Jan 11, 2015

Hello,

When i try to paid a cart with alternate payment method (i test it in guest mode), i have the following message: AttributeError: "sale.sale,12" has no attribute "amount_to_receive".
I can not find any module that defines this field.
And more generally you have a schematic or explanation of the relationship between the various modules (nereid_checkout, nereid_payment_gateway, payment_gateway, etc.) and how its should work to make the payment of sales.

Thank a lot

The complete trace:
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/ccr/Documents/Technique/VirtualEnvs/Tryton3/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/nereid/nereid/application.py", line 433, in dispatch_request
rv = self._dispatch_request(req)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/nereid/nereid/application.py", line 477, in _dispatch_request
result = meth(*_req.view_args)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/checkout.py", line 74, in wrapper
return function(_args, *_kwargs)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/checkout.py", line 96, in wrapper
return function(_args, *_kwargs)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/checkout.py", line 108, in wrapper
return function(_args, **kwargs)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/checkout.py", line 756, in payment_method
rv = cls._process_payment(cart)
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/checkout.py", line 678, in _process_payment
amount_to_checkout = cart.sale._get_amount_to_checkout()
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/ate_community_modules/trytond-nereid_checkout/sale.py", line 353, in _get_amount_to_checkout
return self.amount_to_receive
File "/home/ccr/Documents/Adiczion/technique/tryton/clients/adiczion/ate-dev_32/server/trytond/model/modelstorage.py", line 1174, in getattr
raise AttributeError('"%s" has no attribute "%s"' % (self, name))
AttributeError: "sale.sale,12" has no attribute "amount_to_receive"

@mbehrle
Copy link
Contributor

mbehrle commented Jan 28, 2015

Confirming this issue, no more working on 3.2.

Payment with credit card (payment_gateway_authorize_net installed) is no more possible.

Field "amount_to_receive" was originally part of sale-payment-gateway

openlabs/sale-payment-gateway@e293358

but was replaced as to be seen in

https://github.com/openlabs/sale-payment-gateway/blob/develop/sale.py

but is still referenced as in

6da93ad

Thr problems now:

  1. All those function fields i https://github.com/openlabs/sale-payment-gateway/blob/develop/sale.py currently return a value of 0 when called from payment.

  2. When putting in a valid amount (field), there still raises

127.0.0.1 - - [28/Jan/2015 17:41:25] "POST /de-de/checkout/payment HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid/nereid/application.py", line 433, in dispatch_request
    rv = self._dispatch_request(req)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid/nereid/application.py", line 477, in _dispatch_request
    result = meth(**req.view_args)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/checkout.py", line 66, in wrapper
    return function(*args, **kwargs)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/checkout.py", line 88, in wrapper
    return function(*args, **kwargs)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/checkout.py", line 100, in wrapper
    return function(*args, **kwargs)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/checkout.py", line 740, in payment_method
    rv = cls._process_payment(cart)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/checkout.py", line 671, in _process_payment
    amount_to_checkout
  File "/home/mathiasb/projects/nereid-webshop3.2/src/nereid-checkout/sale.py", line 235, in nereid_pay_using_profile
    return self._pay_using_profile(payment_profile, amount)
  File "/home/mathiasb/projects/nereid-webshop3.2/src/sale-payment-gateway/sale.py", line 427, in _pay_using_profile
    payment_transaction.save()
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/trytond/model/modelstorage.py", line 1386, in save
    self.id = self.create([save_values])[0].id
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/trytond/model/modelsql.py", line 503, in create
    cls._validate(records[i:i + RECORD_CACHE_SIZE])
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/trytond/model/modelstorage.py", line 980, in _validate
    required_test(getattr(record, field_name), field_name)
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/trytond/model/modelstorage.py", line 955, in required_test
    error_args=cls._get_error_args(field_name))
  File "/home/mathiasb/.virtualenvs/nereid-webshop3.2/lib/python2.7/site-packages/trytond/error.py", line 74, in raise_user_error
    raise UserError(error)
UserError: ('UserError', (u'The field "Sale Payment" on "Gateway Transaction" is required.', ''))

So currently there seems to have gone something wrong between the payment modules.

@mbehrle
Copy link
Contributor

mbehrle commented Jul 20, 2015

Can't reproduce with current 3.4.
@2cadz: do you have still this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants