コード例 #1
0
ファイル: ipn.php プロジェクト: nilleroux/payplug
                     $extra_vars['transaction_id'] = $data->id_transaction;
                     $currency = (int) $cart->id_currency;
                     $customer = new Customer((int) $cart->id_customer);
                     /** Get the right order status following module configuration (Sandbox or not) */
                     $order_state = Payplug::getOsConfiguration('paid');
                     $amount = (double) $data->amount / 100;
                     $payplug->validateOrder($cart->id, $order_state, $amount, $payplug->displayName, null, $extra_vars, $currency, false, $customer->secure_key);
                     if (version_compare(_PS_VERSION_, '1.5', '>') && version_compare(_PS_VERSION_, '1.5.2', '<')) {
                         $order_id = Order::getOrderByCartId($cart->id);
                         $order = new Order($order_id);
                         $order_payment = end($order->getOrderPayments());
                         $order_payment->transaction_id = $extra_vars['transaction_id'];
                         $order_payment->update();
                     }
                 }
                 PayplugLock::deleteLock($cart->id);
             }
             Configuration::updateValue('PAYPLUG_CONFIGURATION_OK', true);
         } else {
             echo 'Error : missing or wrong parameters.';
             header($_SERVER['SERVER_PROTOCOL'] . ' 400 Missing or wrong parameters for address', true, 400);
             die;
         }
     } else {
         echo 'Error : missing or wrong parameters.';
         header($_SERVER['SERVER_PROTOCOL'] . ' 400 Missing or wrong parameters for cart', true, 400);
         die;
     }
 } else {
     echo 'Error : missing or wrong parameters.';
     header($_SERVER['SERVER_PROTOCOL'] . ' 400 Missing or wrong parameters', true, 400);