开发者

How to distinguish between a Google or Paypal response

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜