I am working on shopping cart applica开发者_如何学Pythontion in which there is an integration of PayPal and Google Checkout. All the code is working fine, but how do I know if the payment is done by Google or PayPal?
The response page for both Google Checkout and PayPal is the same. After getting response I'm adding all the information to my database and removing items from the session, and then getting redirected to myindex page....
You could set a session variable or some sort of flag when executing the specific code for PayPal or Google.
Example:
payment() {
$vendor = selectedPayementVendor();
if($vendor == 'Google') {
$_SESSION['paymentVendor'] = 'google';
} elseif($vendor == 'PayPal') {
$_SESSION['paymentVendor'] = 'paypal';
} elseif ...
}
精彩评论