Jump to content

Recommended Posts

I want to implement PayPal in my website. I'll be using ExpressCheckout method.

 

I know there are following steps:

1. Cart page on a website

1a. Provide custom IPN URL in PayPal form (notify_url).

2. Redirect to PayPal payment page.

3a. On success redirect to my "payment confirmation" page.

3b. On false redirect to payment cancelled page.

4. Enable IPN in PayPal account.

5. Prepare payment handler page. PayPal response will be sent to this page.

 

Everything above has been tested and it's working perfectly.

 

Anyway, I have few questions.

 

I need to log transactions in database 'transactions' table. So..on checkout page, I insert a row with user data, date. Now I'm wondering about one small thing. What about transaction ID? I was never implementing PayPal before, more I'm reading, I'm know less :)

 

I'm testing payments in sandbox. When payment is done, it returns to provided URL with following $_GET data: ?token=EC-8JP09047FK347153S&PayerID=C9UCCD3968V52. But when I test IPN in my sandbox it return a field called txn_id.

 

Now time for my questions:

1. Is this the same as token?

2. How transactions are usually logged in into database? What is used as 'key' when

3. Is it possible to define token and payer_id before redirecting user to PayPal checkout?

4. When checking transaction on IPN response handler, is txn_id the most important transaction field? My biggest issue is to handle IPN response. How could I know transaction ID when I do not have any key to compare?

 

Any help will be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/211955-paypal-expresscheckout-help-needed/
Share on other sites

I suppose you are holding the cart and all of the available item info on your site, and only passing the total value to paypal.  If so, you can send an 'item_number' over to paypal, which could be your transaction ID.  This value will be passed back to you on transaction completion.

 

Paypal variables

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.