GithubHelp home page GithubHelp logo

thelabnyc / django-oscar-api-checkout Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 5.0 845 KB

Automated mirror of https://gitlab.com/thelabnyc/django-oscar-api-checkout

License: ISC License

Python 99.41% Dockerfile 0.08% Makefile 0.11% Shell 0.40%

django-oscar-api-checkout's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-oscar-api-checkout's Issues

Issue with fetching payments states

The payment method selection during checkout get stored in session during checkout, the subsequent request to /api/checkout/payment-states// is no longer have session attached to it as the UI is served from different Host and the django service is hosted in different domain. which result in 404 response as it couldn't find the session information. Relevant peace of code..
//views.py class PaymentStatesView(generics.GenericAPIView): def get(self, request, pk=None): if pk and int(pk) != request.session.get(CHECKOUT_ORDER_ID): return Response(status=status.HTTP_404_NOT_FOUND)
Am i Missing something? Thanks :)

How to add new payment method?

I am trying to add new payment method, I created new payment method, and required handling of payment authorization and validation from the Payment Gateway. But on submitting order with payment instrument selection by user, I am getting the below error.

Internal Server Error: /api/checkout/
Traceback (most recent call last):
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 52, in inner
return func(*args, **kwds)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/django/views/generic/base.py", line 71, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/rest_framework/views.py", line 505, in dispatch
response = self.handle_exception(exc)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/rest_framework/views.py", line 465, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/rest_framework/views.py", line 476, in raise_uncaught_exception
raise exc
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/rest_framework/views.py", line 502, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/oscarapicheckout/views.py", line 107, in post
data=c_ser.validated_data['payment'])
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/oscarapicheckout/views.py", line 153, in _record_payments
new_states[key] = record(key, method_data)
File "/Users/as/myprojects/newproject/lib/python3.6/site-packages/oscarapicheckout/views.py", line 141, in record
order_balance[0] = order_balance[0] - state.amount
AttributeError: 'dict' object has no attribute 'amount'

My submitted data is following.
{ basket: "http://127.0.0.1:8080/api/baskets/14/" payment: {payme: { amount: "15000.00" enabled: true }} shipping_address: {id: 2, title: "Mr", first_name: "Eric", last_name: "S", line1: "Gp", โ€ฆ} shipping_charge: {currency: "USD", excl_tax: "0.0", tax: "0.0"} shipping_method_code: "free-shipping" total: "15000.00" }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.