PayPal payment confirmation

sonibvc
Contributor
Contributor

Hi guys. I am a little lost and I hope someone could help. I trying to get my website to recognise a paypal payment. The flow I am trying to achieve is this:

 

1. User registers with Email and Password on my site
2. Then he pays via PayPal
3. His account from step 1 is automatically unlocked to access some content.
4. How do I get my site to "know" the PayPal payment has been made for this specific user?

Login to Me Too
1 REPLY 1

Nexus_Software
Contributor
Contributor

Hello, 

 

One way to achieve your desired result is to use the Payment Data Transfer feature.

With Payment Data Transfer ...

  1. A customer submits a payment.
  2. PayPal sends the transaction ID of the payment through HTTP as a GET variable (tx). This information is sent to the Return URL you specified in your PayPal account profile.
  3. Your return URL web page contains an HTML POST form that retrieves the transaction ID and sends the transaction ID and your unique PDT token to PayPal.
  4. PayPal replies with a message indicating SUCCESS or FAIL. The SUCCESS message includes transaction details, one per line, in the <Key>=<Value> format. This key-value pair string is URL encoded.
  5. Your web page can parse the message and then determine and act on the status of a transaction. In this case the action would be to update your database with the customer's paid status and allow them access. 

The transaction details can include:

payer_emailCustomer's primary email address. Use this email to provide any credits. Length: 127 characters.
payer_idUnique customer ID. Length: 13 characters.

 

To enable Payment Data Transfer, do the following:

  • Check your account status. Login to your PayPal business account on paypal.com.

    Click your profile name in the top right corner of your account and then click Account Settings.

    Note: If you do not see the profile icon in the top right, go to Profile within the My Account tab. If you do not see this option either, upgrade your account to a PayPal business or premier account.

    Click on My settings and confirm your Account type is either Premier or Business.

  • Modify your PayPal Profile. Navigate to My selling tools, and click Update next to Website preferences, which takes you to the Website payment preferences page. Enable Auto Return for Website Payments. Then, specify a Return URL and enable Payment Data Transfer. Payment Data Transfer requires the Return URL setting. PayPal displays an Identity Token. Copy and save it; add it to the script on your Return URL page.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.