开发者

Grabbing Paypal returned values

these are the steps in my app:

1) user enters 2 variables (credits and pin)

2) goes to paypal with button and makes the payment

3) paypal automatically returns the user to my site

4) ???

...

So 2 ques开发者_如何学JAVAtions:

A) step 4 should grab the same original 2 variables that the user entered... how can i achieve that? B) what happens if the user doesnt come back to the site once the payment is complete? i have to modify the database information.


I use Micah Carrick's Paypal IPN Class in my application. To tied your own variables to a paypal payment, you can create a simple cart and invoice system. When making payment using paypal, you can pass the invoice parameter. Make sure that the invoice number is unique for each transaction.

Read the Paypal IPN Introduction and take a look at the sample code provided. Micah's class actually is just a wrapper from a sample code provided by Paypal.

To modify the value in your side, handle it in ipn validation handler page. Paypal send data to this page when payment is made, so even when the user didn't click back to your application page, you will still get the payment data based on invoice number and can update the value in your database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜