开发者

How to distinguish between a Google or Paypal response

开发者 https://www.devze.com 2023-01-14 14:55 出处:网络
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 G

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 ...
}
0

精彩评论

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