olaoyesunday Posted April 17, 2015 Share Posted April 17, 2015 Dear Admin, I'm integrating a payment processor named Global pay by Zenith bank Nigeria on my site. The site is subscription site similar to Knowledge is power. My script is the same as registration.php in chapter 6 the only difference is where I change paypal code for global pay. I want to ask 2 questions : 1) How can I generate transaction_id on my site for payment processor from my code? I thought paypal generated it for us behind the scene but here they want my site to generate it for the payment processor. 2) How do I include receipt.php for customer to print after completing the order on paypal without relying on the one paypal will send to the customer like we did in chapter 13? Link to comment Share on other sites More sharing options...
Larry Posted April 21, 2015 Share Posted April 21, 2015 If the payment processor wants you to generate it for them, you'll need to generate something random, unique, and secure. You could use a tool like this one to do that: https://github.com/ircmaxell/RandomLib For the receipt, I thought I included an example of that in the book, or in the downloadable code as an extra. Link to comment Share on other sites More sharing options...
olaoyesunday Posted April 22, 2015 Author Share Posted April 22, 2015 Thanks very much. After downloading the library from github, the instruction is not clear on how to make use of the library. I tried using RandomLIb/generator generator->generateString(32, 'abcdf'). it was saying the class not found. I tried using rand(1111222233334444, 5555666677778888). it works but not given me the consistent 12 digits number? please, bail me out. Link to comment Share on other sites More sharing options...
Larry Posted April 22, 2015 Share Posted April 22, 2015 Sure thing. First, you include the library. Then you would do this: $factory = new RandomLib\Factory; $generator = $factory->getMediumStrengthGenerator(); string$bytes = $generator->generate(32) Link to comment Share on other sites More sharing options...
olaoyesunday Posted April 22, 2015 Author Share Posted April 22, 2015 Dear Larry, thanks very much. It is now clear Link to comment Share on other sites More sharing options...
Recommended Posts