コード例 #1
0
ファイル: ipn.php プロジェクト: nilleroux/payplug
         echo 'Error while checking signature';
         header($_SERVER['SERVER_PROTOCOL'] . ' 500 Error while checking signature', true, 500);
         die;
     }
 }
 if ($data && $bool_sign) {
     /** Data is an object */
     $cart = new Cart($data->custom_data);
     if (Validate::isLoadedObject($cart)) {
         $address = new Address((int) $cart->id_address_invoice);
         if (Validate::isLoadedObject($address)) {
             Context::getContext()->country = new Country((int) $address->id_country);
             Context::getContext()->customer = new Customer((int) $cart->id_customer);
             Context::getContext()->language = new Language((int) $cart->id_lang);
             Context::getContext()->currency = new Currency((int) $cart->id_currency);
             PayplugLock::check($cart->id);
             $order = new Order();
             $order_id = $order->getOrderByCartId($cart->id);
             /**
              * If existing order
              */
             if ($order_id) {
                 /**
                  * If status paid
                  */
                 if ($status == Payplug::PAYMENT_STATUS_PAID) {
                     $order = new Order($order_id);
                     /** Get the right order status following module configuration (Sandbox or not) */
                     $order_state = Payplug::getOsConfiguration('waiting');
                     $current_state = $order->getCurrentState();
                     if ($current_state == $order_state) {