Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,149,791 members, 7,806,191 topics. Date: Tuesday, 23 April 2024 at 12:45 PM |
Nairaland Forum / Science/Technology / Programming / Payment System Integration Webpay(interswitch) With Php (3243 Views)
[Tutorial Post] How To Integrate Paystack Payment System With PHP / 10 Nights Of Cloning Nairaland With PHP / Interswitch Webpay Integration With Lightspeed Retail (2) (3) (4)
Payment System Integration Webpay(interswitch) With Php by dplumptre(m): 3:41pm On Dec 11, 2015 |
Hello guys, I have worked on a few payment platforms before but this particular one gave me alot of headaches also due to the poor documentation , it can be very frustrating but then I decided to do a quick guide to help anyone facing this. I had some help from a guy “Akinyele ” after reading some steps he wrote on his blog. Firstly , there are some basic parameters you will be given from interswitch, the file is usually called webpay demo merchant , so its the information here that you will use to set up 1. product_id : This value will be in the demo document from interswitch 2 Amount : The amount, note that this will be in kobo ,thats the way you send it and this can be done by multipling it with 100 3 Currency : This value will be in the demo document usually 566 for naira 4 site_redirect_url : This will be the page you will be redirected to after the payment , here is where you will pickup the request from interswitch service and know if the transaction was successful or not , here is also where you can display your transaction receipt 5 site_name : website name 6 cust_id : this is should be unique , I used email 7 txn_ref : this should be a unique code , you can use the time() orappend it with something, the fact is that it much be unique for every transaction 8 MacKey : This value will be in the demo document, it very long about 100 char or so 9 $hash -> this is a hash you need to create by concatenating some values together , its very important because if there is any little mistake you wont even see the payment page to begin with , every thing has to be on point, it will also be 512 hashed 10: pay_item_id : This value will be in the demo document from interswitch To make things easy we can define a constant file and include it in your scripts for the variables that wont change it will look like this below
If all things go well you should see the payment page, but note that you will need to store data in the db I wont cover that part though that pretty basic. After payment you will redirected to the response.php page here you need to make use of the webpay service 1. note that it returns transaction reference
in the above code I am using the xml there is a function I created getresponse() it accepts 4 values the product id, the mackey, amount * 100, also the transaction ref so you can create your receipt using the response code if 00 its successful etc Navigate to my blog to view the getresponse() function details http://overallheuristic.com/payment-system-integration-webpayinterswitch-with-php/ site : http://overallheuristic.com twitter : @dplumptre fb :https://www.facebook.com/ 1 Like
|
Re: Payment System Integration Webpay(interswitch) With Php by spymybox: 3:40pm On Dec 18, 2015 |
please how can i generate The SHA 512 value productidtransactionreferencemackey. on my site can you help bro ? |
Re: Payment System Integration Webpay(interswitch) With Php by ajirapsy(m): 11:13pm On Dec 19, 2015 |
spymybox: I don't know the language you are using, but for Python, you should use the hashlib library. Example: hashed_value = hashlib.sha512(productidtransactionreferencemackey).hexdigest() I once used the above example for a client's project. |
Re: Payment System Integration Webpay(interswitch) With Php by dplumptre(m): 12:00pm On Dec 22, 2015 |
spymybox: like I explained earlier the $hash value we are trying get is the value in the form below <input name=”hash” type=”hidden” value=”<?php echo $hash; ?>” /> inorder to do this, you will need to concatenate these values together , I intentionally made some of these values constants so you can just include them in your file since they wont change . I have explained how I got the values earlier. $concatenation = $txnref.P_ID.P_I_ID.$amountwp.SITE_REDIRECT_URL.MAC_KEY; then php comes with its own hash , below $hash = hash(‘sha512’,$concatenation); so this is the $hash value you add to the form below
if you noticed, I did not add any submit button ,thats because I used ajax , but you can add a manual submit button as long as it goes to the url "INTERSWITCH_URL" which is this "https://stageserv.interswitchng.com/test_paydirect/pay" if it goes well ,you will be redirected to the payment page , but you know you will be required to create a database to store the values also , so that you can have a log incase you need to check or whatever but they actually made this compulsory because, the interswitch guys will confirm this before moving you LIVE ,just put that in mind as a side note 1 Like |
Re: Payment System Integration Webpay(interswitch) With Php by topePhysics: 11:18am On Apr 18, 2019 |
Hi, please how do I sign up just for a test account to obtain the details above? Or do I have to fill the registration form in their docs |
(1) (Reply)
How Can I Create An Embedded Database In A Desktop Application / 10 Of The Best Programming Fonts / Please Need Help With Writing These C++ Programmes Please This Is Really Urgent
(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. 24 |