Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
olaoyesunday

Transaction_Id And Receipt In Chapter 6

Recommended Posts

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?

 

 

 

 

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Sure thing. First, you include the library. Then you would do this:

$factory = new RandomLib\Factory;
$generator = $factory->getMediumStrengthGenerator();
string$bytes = $generator->generate(32)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...