Save data upon PayPal checkout in
I am using CodeIgniter. My application goes like this,
- user selects a topic from a dropdown
- user is able to type some text/questions inside a text area under that dropdown
- user clicks the PayPal checkout button and pay for asking a question
How will I save the id of the selected topic and the typed question if my submit button is calling PayPal's processing stuff and not my own CodeIgniter controller action thing?
Here's the code of the submit/checkout button of PayPal,
<form action=https://sandbox.paypal.com/cgi-bin/webscr method=post>
<input type=hidden name=cmd value=_cart&g开发者_如何转开发t;
<input type=hidden name=business value="test@gmail.com">
<input type=hidden name=item_name value="test">
<input type=hidden name=item_number value="1">
<input type=hidden name=amount value="<?php foreach($query3->result() as $row){echo $row->price; } ?>">
<input type=hidden name=quantity value="1" disabled="disabled">
<input type=hidden name=currency_code value="USD">
<input type="hidden" name="return" value="http://your-website.com/after-payment-page.html" / >
<input type=image id="checkout" src="https://www.paypal.com/images/x-click-but6.gif" Border="0" name=submit><br>
<input type=hidden name=add value=1></form>
I split the pages into two parts instead
You can use notify_url
The URL to which PayPal posts information about the transaction, in the form of Instant Payment Notification messages
Example:
<input name="notify_url" value="http://yourdomain.com/controller/method" type="hidden">
The example above receives some $_POST
variables from PayPal when the payment is completed, even if the customer never returns to your website.
You can save the topic, question and any other information that gets passed in the above method.
You can attach another event to the submit button For example:
$("#checkout").click(function() {
saveTheParmYouNeed();
});
精彩评论