Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Alan Mattan贸
PLUS
Alan Mattan贸
Courses Plus Student 12,188 Points

Why PayPal Auto Return url (back to site) after 10sec is different from link url option at the end of transaction

I just want to point out and advice other that the Paypal auto return URL is different from the link. So for example if a client at the end of the transaction just wait the 10 seconds, then the URL will be for example:

yoursite.com/paypal/process.php?tx=78B411&st=Completed&amt=2%2e00&cc=USD&item_number=1-7NKG7WK

And instead if the client click the link at the end of the transaction, it will be:

yoursite.com/paypal/process.php?tx=78B411&st=completed&amt=2%2e00&cc=usd&item_number=8%7nkg7wk

So looking in the arry will be:

// auto retun 10sec
Array ( [tx] => 78B411 [st] => Completed [amt] => 2.00 [cc] => USD [item_number] => 1-7NKG7WK )

// auto retun link
Array ( [tx] => 78b411 [st] => completed [amt] => 2.00 [cc] => usd [item_number] => 1-7nkg7wk )

What I want to point out is that if you make a if to control the information:

if ( $cc == "USD" ) { // payment completed

or

if ( $item_number == "1-7NKG7WK" ) { // payment completed

You can fail because cc can be usd and item_number can be 1-7nkg7wk . How to resolve this?

Do i need to use only :

$cc = strtoupper($cc);

To convert all the info to uppercase? or I'm messing something else? thx.