Ok this is the most unsoveable problem i have ever dealt with and the worst is i know it can be solved because someone has done it.

I want my users after succsefull payment to be redirected to my site where i will capture their details and give them a bus ticket.

the redirect works perfect if you are signed in as a paypal user, but when they click pay by debit or credit card the redirect does not work. Now i can deactive the option to allow only express payment but then it asks your username and password and forces you to sign in anyways.

I have redirect enabled, i have put a hidden field with my redirect url and all works fine but not for debit/credit card straight payments. so I read that paypal doesnt allow this but then i found this site and it works for these guys, how did they do it?

if you just select a accomodation there it will take you to a page where you can actually select pay by debit/credit card. this will then take you to a page where theres a check box which you can deactive so you dont have to enter your username and password and you can just do a straight payment and BE REDIRECTED without being forced to sign up an account..

Please hope someone can help me

Regards

Jaco

Dani AI

Generated

Short summary and root cause (references to the thread)

As reported, the form-based redirect (hidden return field / auto-return) will reliably send buyers back only in some PayPal flows; guest-card (debit/credit) payments do not always trigger an automatic browser redirect. This is documented behavior: Auto Return and the “Account optional” (guest checkout) flow interact differently, and PayPal may present a choice or require account creation instead of an automatic redirect. (developer.paypal.com)

Concrete, practical fix (what to implement)

  1. Treat the browser redirect as a UX convenience only; do not rely on it for issuing tickets.
  2. Enable Auto Return and Payment Data Transfer (PDT) in the merchant PayPal account to get return data when the buyer is returned. (paypal.com)
  3. Implement Instant Payment Notification (IPN) (server-to-server): supply a notify_url and build an IPN listener that validates PayPal’s confirmation and then creates the ticket/records the sale. IPN is the authoritative method because it does not depend on the buyer clicking a button or staying in the browser. (developer.paypal.com)

Minimal example (fallback / useful fields)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_xclick">
  <input type="hidden" name="business" value="seller@example.com">
  <input type="hidden" name="return" value="https://site/thank-you">
  <input type="hidden" name="notify_url" value="https://site/ipn-listener">
  <input type="hidden" name="rm" value="2">
</form>

Use rm/return/PDT as a convenience fallback; do ticket issuance only after IPN/PDT verification. (developer.paypal.com)

Longer-term: migrate to an API-based flow

Sites that need deterministic behaviour for card payments usually move to API-based PayPal Checkout / Orders (or Express/REST) so the server captures payment and then redirects to the ticket page under merchant control. This removes reliance on client-side auto-return. (developer.paypal.com)

Testing and troubleshooting

Test all permutations in the PayPal Sandbox and in a private/incognito browser to simulate guest buyers; check IPN history/logs when something doesn’t arrive. Confirm merchant account settings (Auto Return, PDT token, Account Optional) and that the business email used in the button is confirmed. (developer.paypal.com)

Notes tied to earlier replies

was right that integration method matters — the reliable solution is server-side confirmation (IPN/PDT or API capture) rather than counting on the buyer’s browser to return.

Member Avatar for Member #949455

if you just select a accomodation there it will take you to a page where you can actually select pay by debit/credit card. this will then take you to a page where theres a check box which you can deactive so you dont have to enter your username and password and you can just do a straight payment and BE REDIRECTED without being forced to sign up an account..

The issue you are having is that you didn't integrated Paypal correctly. Once you are on the Paypal page it doesn't redirected. It only redirected the page once the customer click submit button, then it goes straight to the PayPal page.

Read this about integrated PayPal:

http://www.9lessons.info/2011/03/payment-system-with-paypal.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.