Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,466 members, 7,816,090 topics. Date: Friday, 03 May 2024 at 04:12 AM

DJANGO Payment Solutions - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / DJANGO Payment Solutions (2510 Views)

Django Payment Gateway Integration How To Build A Payment System / Learn How To Build A Realtime Chat Application With Django, Rabbitmq And Vue.js / Let's Build A Simple Blog With Python(django) (2) (3) (4)

(1) (Reply) (Go Down)

DJANGO Payment Solutions by EngtTemmy(m): 8:24am On Apr 11, 2020
Good morning.
Please i need help from someone who has integrated paystack or interswitch on a website using DJANGO.
Thanks.
Re: DJANGO Payment Solutions by Playforkeeps(m): 9:46am On Apr 11, 2020
Hey could you at least specify what type of problem? Is it with Django ? Or from the payment provider’s API?
Re: DJANGO Payment Solutions by EngtTemmy(m): 1:43pm On Apr 11, 2020
Playforkeeps:
Hey could you at least specify what type of problem? Is it with Django ? Or from the payment provider’s API?
Thanks.
I want to learn how to integrate it, but couldn't find a good reference material to use.
Re: DJANGO Payment Solutions by kensmoney(m): 2:58pm On Apr 11, 2020
Check their documentation
Re: DJANGO Payment Solutions by EngtTemmy(m): 7:58pm On Apr 11, 2020
kensmoney:
Check their documentation
Alright
Re: DJANGO Payment Solutions by Playforkeeps(m): 10:48pm On Apr 11, 2020
EngtTemmy:

Alright

Have you had a look at any documentation yet ?
I didn’t bother looking up anything on interswitch as I assume that enough people would have done that already considering that interswitch is a global company and will definitely support Django easily, you just have to do that work .
But as for Paystack, apparently the API code is implemented in PHP, but this is 2020 lol, so I’d just recommend you go with Node if you know any JavaScript.
Here’s the guide - https://developers.paystack.co/docs/getting-started
Re: DJANGO Payment Solutions by Ayemileto(m): 8:29am On Apr 12, 2020
You can check out flutterwave.


I think they have some pre written code for Python.
Re: DJANGO Payment Solutions by EngtTemmy(m): 9:31am On Apr 12, 2020
Playforkeeps:


Have you had a look at any documentation yet ?
I didn’t bother looking up anything on interswitch as I assume that enough people would have done that already considering that interswitch is a global company and will definitely support Django easily, you just have to do that work .
But as for Paystack, apparently the API code is implemented in PHP, but this is 2020 lol, so I’d just recommend you go with Node if you know any JavaScript.
Here’s the guide - https://developers.paystack.co/docs/getting-started
I don't know JavaScript, maybe i will learn it.
Interswitch does not support DJANGO
Re: DJANGO Payment Solutions by EngtTemmy(m): 9:32am On Apr 12, 2020
Ayemileto:
You can check out flutterwave.


I think they have some pre written code for Python.

I will check it out.
Thanks
Re: DJANGO Payment Solutions by silento(m): 11:50am On Apr 12, 2020
Some people sef read their documentation be it js,php,python or any language u can implement your own payment system unless u are not a programmer , coz I don't understand why a programmer will asking for already made code on ordinary put,get http requests
Re: DJANGO Payment Solutions by Playforkeeps(m): 1:45pm On Apr 12, 2020
EngtTemmy:

I don't know JavaScript, maybe i will learn it.
Interswitch does not support DJANGO

Yea you’re right, I just took a look at it. You just have to find another payment alternative or team up with a node dev
Re: DJANGO Payment Solutions by EngtTemmy(m): 5:57am On Apr 13, 2020
silento:
Some people sef read their documentation be it js,php,python or any language u can implement your own payment system unless u are not a programmer , coz I don't understand why a programmer will asking for already made code on ordinary put,get http requests

If they don't support it, there is no way one can implement it. For example, to implement stripe or PayPal with Django, you have to import from stripe or PayPal module in your code.
Re: DJANGO Payment Solutions by silento(m): 10:49am On Apr 13, 2020
EngtTemmy:


If they don't support it, there is no way one can implement it. For example, to implement stripe or PayPal with Django, you have to import from stripe or PayPal module in your code.

Talk about things you know any language that can do http request like post and get can implement almost all payment I know all they do is do http post request with auth headers then get respond as Json or text or etc
Re: DJANGO Payment Solutions by EngtTemmy(m): 6:41pm On Apr 13, 2020
Alright sir, it seems you are very knowledgeable in this field, can you tutor me.
I am still learning.
I am into CSS, HTML AND DJANGO
Re: DJANGO Payment Solutions by silento(m): 12:37am On Apr 14, 2020
See what I was trying to make u understand is that every thing in programming is 0s 1s not a magical files or jargons

Most api calls are like normal http request you do like visiting nairaland with your browser but this time around with small flavours that's the header

And instead of get mostly is post method


For example a php example of haystack


$curl = curl_init() here library that do the http is fired up

$email = "your@email.com";
$amount = 30000; //the amount in kobo. This value is actually NGN 300

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.paystack.co/transaction/initialize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount'=>$amount,
'email'=>$email,
]),
CURLOPT_HTTPHEADER => [
"authorization: Bearer sk_test_36658e3260b1d1668b563e6d8268e46ad6da3273", //replace this with your own test key
"content-type: application/json",
"cache-control: no-cache"
],
));

If you look at about incomplete code u will see that
The url was visited
https://api.paystack.co/transaction/initialize
But instead as get now as post and post data was supplied which is the amount etc

Then header with auth and other was also supplied once the api verify the auth it will go to post data and perform what's it is supposed to do


Now to reimplement this in python http request library is what you need if u are good with python finding such library in standard lib won't be difficult for you

2 Likes

Re: DJANGO Payment Solutions by Playforkeeps(m): 7:44am On Apr 15, 2020
silento:
See what I was trying to make u understand is that every thing in programming is 0s 1s not a magical files or jargons

Most api calls are like normal http request you do like visiting nairaland with your browser but this time around with small flavours that's the header

And instead of get mostly is post method


For example a php example of haystack


$curl = curl_init() here library that do the http is fired up

$email = "your@email.com";
$amount = 30000; //the amount in kobo. This value is actually NGN 300

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.paystack.co/transaction/initialize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount'=>$amount,
'email'=>$email,
]),
CURLOPT_HTTPHEADER => [
"authorization: Bearer sk_test_36658e3260b1d1668b563e6d8268e46ad6da3273", //replace this with your own test key
"content-type: application/json",
"cache-control: no-cache"
],
));

If you look at about incomplete code u will see that
The url was visited
https://api.paystack.co/transaction/initialize
But instead as get now as post and post data was supplied which is the amount etc

Then header with auth and other was also supplied once the api verify the auth it will go to post data and perform what's it is supposed to do


Now to reimplement this in python http request library is what you need if u are good with python finding such library in standard lib won't be difficult for you

Just to clear a few misconceptions, you can't just access an API's endpoints in any language/library you want. API's are designed and optimised for specific usage on specific platforrms. Yes, Computers are about 0's and 1's, but that doesnt mean i can just implement any library i want because that is what im comfortable with, all languages are not built equal and the backend may implement some type of auth that just doenst have a mature counterpart in another language if it isnt supported by the target platform, thats like trying to deploy a web page in a language not supported by Browsers.
Paystack supports PHP natively so everything is abstracted at the backend into the API for the developer to use, so it would be impossible to reimplement a codebase that you cant even understand what the native code does at the server-side. The best thing for OP is to write a wrapper around the Php API in Python, but that seems wasteful. The best thing is to learn a new Language/framework if you intend to interact with API's across the web on a consistent basis. I would recommend you sharpen your Node/JS skills.

1 Like

Re: DJANGO Payment Solutions by EngtTemmy(m): 10:06am On Apr 15, 2020
I think i will go for flutterwave, they have support for python, and their a library for DJANGO on it. (DJANGORAVE).
Re: DJANGO Payment Solutions by silento(m): 10:23am On Apr 15, 2020
Playforkeeps:


Just to clear a few misconceptions, you can't just access an API's endpoints in any language/library you want. API's are designed and optimised for specific usage on specific platforrms. Yes, Computers are about 0's and 1's, but that doesnt mean i can just implement any library i want because that is what im comfortable with, all languages are not built equal and the backend may implement some type of auth that just doenst have a mature counterpart in another language if it isnt supported by the target platform, thats like trying to deploy a web page in a language not supported by Browsers.
Paystack supports PHP natively so everything is abstracted at the backend into the API for the developer to use, so it would be impossible to reimplement a codebase that you cant even understand what the native code does at the server-side. The best thing for OP is to write a wrapper around the Php API in Python, but that seems wasteful. The best thing is to learn a new Language/framework if you intend to interact with API's across the web on a consistent basis. I would recommend you sharpen your Node/JS skills.

Even jQuery $.post can do the job here the api in particular is not language dependent any language that can do http request can call to paystack api

(1) (Reply)

Introduction To Crm Application Development Using Remedy / What’s the Most Sophisticated Software Ever Written / Where Are The Nigerian UI/UX Design Gurus

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 31
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.