Integrating a payment gateway with Django-Oscar? - django

I want to integrate a payment gateway with oscar. I have integrated oscar-paypal it works fine. Should I follow oscar-paypal and try to emulate it ?
This document doesn't gives the starting information but not exactly ?
I need this. To create order, change basket status, make payments, send email, and many other steps that oscar-paypal is doing.

I think you can use payu which is also very easyily available and can be customized.
pip install git+https://github.com/SalahAdDin/django-oscar-payu#egg=payu
this would clone the payu application which has similar implementation as oscar-paypal. then edit the views.py in the nonseamless navigate to through the code and change the self.sessions.['currency'] to the currency which u want to use but the default currency it works with is INR. Then your payment_detail.html just replicate what you have as in paypal and change the paypal url to payu. Just switch paypal to payu. That is all.
credit to https://github.com/SalahAdDin/

Following the steps of Oscar Paypal is a pretty good idea. It's a pretty well written project. There are facades written that abstract the details of communicating with the Paypal Express and PayFlow APIs. The facade functions are then called from the views.py in each package, which is where the real integration with Oscar begins.
The Paypal Express implementation for example is integrated with Oscar pretty much by subclassing the PaymentDetailsView class and calling the necessary functions implemented in the paypal.express.facade package. There is also a ShippingOptionsView that provides some linkage with Paypal shipping.

Related

Using stripe.js with dj-stripe

I'm using django and I want to integrate stripe using the abstraction layer dj-stripe.
From what I understand from the documentation, ElementJs with Payment Intent is the preferred way to allow users to enter their payment details. see https://dj-stripe.dev/stripe_elements_js/
However, there is no documentation on how to connect dj-stripe with stripe.js. The first step of the usage documentation in dj-stripe already assumes payment methods have been connected (https://dj-stripe.dev/usage/subscribing_customers/). I looked through the code of dj-stripe and it seems to have Payment Intent classes, but I can't figure out how to use them.
How can I generate a client secret for customers created in dj-stripe that can then be used in stripe.js? (Or if I'm not on the right path, what should I do instead to allow adding payment details to be used in dj-stripe)
dj-stripe is a Python backend framework, and theoretically it should work with any frontend including pure stripe.js. You should follow Stripe official Doc and adapt. They also have an example project in Python (not Django though).

djangorestframework browsable api: how to show all available endpoints urls?

In djangorestframework, there is a browsable api. But how do I show a user an entire bird's eye view of all the possible API calls that he/she can make? I can only see one at a time right now and the user would have to already know the correct URL beforehand
i.e.,
http://localhost:8000/users
http://localhost:8000/books
http://localhost:8000/book/1/author
Thank you!
The answer is as Klahnen said. Use this:
https://django-rest-swagger.readthedocs.io/en/latest/
It works out of the box for me and it is exactly what I was hoping for.
I still maintain, though, that the term browsable API implies that there is a table of contents available for consumers of your API to see. This app is a lifesaver and perhaps it should be included!
Django-Rest-Swagger as mentioned in the accepted answer is no longer maintained.
This is a good alternative
https://github.com/axnsan12/drf-yasg
Django-Rest-Swagger doesn't support OpenAPI 3.0 and is unlikely to support it soon, so if you want an actively maintained library that supports OpenAPI 3.0 then you should use drf-spectacular. It mostly works out of the box, and you can customize it a lot.
A side note:
Your api client needs access to the internet so that it gets the swagger UI or ReDoc from CDNs. Alternatively you can serve those static files from your service with an optional additional package, the drf-spectacular-sidecar

Need help to add front-end on slatwall eCommerce

I am trying to build the eCommerce store by using Slatwall and lucee. Slatwall is the ColdFusion based eCommerce framework. The admin part is working fine. But I could not create the user side. I also referred the slatwall documentation. But no luck I couldn't seen any clear example and document for adding the front end on slatwall. If anyone knows help me please?
Slatwall frontend document
As OP says, SlatWall has excellent $upport, that's where they make a living. You now have three choices for a front end:
1) Slatwall latest versions have their own integrated CMS now. I'd recommend you export your product info, install the latest Slatwall, import the data back in.
2) Load MuraCMS, an Open Source Content Management (i.e. front-end) system that has integration to Slatwall (or the other way round, IIRC)
3) Roll your own in ColdFusion after learning ins and outs of the Slatwall api. Not recommended unless you're already CF experienced and have some previous experience with an api, any api.
For completeness I am going to answer this question even though its months old, for anyone else that views this.
You have a couple options here but the easiest way:
There is a complete example of a fully implemented Slatwall site including product listing pages, shopping-cart, and checkout included with Slatwall.
You may view the sample site by visiting http://{yourslatwallsite}/meta/sample
On the sample site, you can choose from the menu to view your products, add them to your cart, or checkout. Make sure your products are both active and published in the admin or you will not see them on the sample site. If you go through the .cfm pages that makeup the sample site, there are many examples documented (as comments in the code). Note that the actual .cfm files will be stored in /public/views/xxx.cfm and the meta folder just references them. /public/views/templates/slatwall-productlisting.cfm for example has complete examples on listing products on the frontend.
The sample site is powerful enough that you could restyle it and use it as your store

Django 1.8: Password Protect Entire Project

I have built my first Django App! It is built to help my business track inventory. As such, I would not like it to be publicly available.
Maybe someday I will set up multiple user accounts, etc, but for now I really just need a basic password gate to get it up and running.
Does anyone have any middleware that works for this? All the solutions that I am finding are pretty old and they do not seem to work with the latest version of Django.
If you just need a single username/password couple, handling it directly via HTTP authentication in your webserver configuration will be the easiest way to achieve this. The benefits of this approach are:
You can set it up in 5 minutes: example with nginx, example with apache
You don't have to write code you'll delete later
It will protect all your website, including static files, third-party apps, admin, etc.
I found an answer that worked for me posted here:
#login_required for multiple views
Make sure the LOGIN_REQUIRED_URLS_EXCEPTIONS path is correctly set to your login page.

templates to use with Zend/CodeIgniter framework?

I'm trying to build an online recruitment site using the Zend/CodeIgniter framework. I wanted to know which of the two frameworks is the easiest to use and which gives support for templates.I want to write minimum code as possible.
I has hoping I could use a template or some form of CMS that would allow me to quickly create (or automatically provide) an admin and user profile section. Users will need to enter their CV details, modify their account, search and apply for jobs. The admin will then be able to search for applicants based on qualifications, job role, etc.
are there any templates I can use on top of the Zend or CodeIgniter framework to get done the majority of the work?
Thanks
With your needs i like to go with cakePHP, it just need models to be ready and with scaffolding admin panel is good, with Auth and causal baking user section is ready too
With Zend, it usually takes some time to get the things done.