Двойные / дублированные платежи Prestashop

Цель : – Остановить дублирование платежей

Я использую Prestashop версии 1.6.1.0. И у меня есть приложение в Ios с apis в slim framework.

Когда я заказываю что-то с конца Ios, на панели администратора есть 2 записи. введите описание изображения здесь

Ниже приведены модули, которые активны на моей панели администратора.

введите описание изображения здесь

Я попытался отключить модули и выполнить платеж после, но не повезло.

Более того, я нашел двойную проблему Prestashop, которая тоже не помогла!

Обновить :-

Мой API для оплаты полосы: –

$app->post('/makeStripePayment', function() use($app){ //Log file : $myfile = "log_stripe.txt"; $txt = file_get_contents($myfile); $txt .= "######### makeStripePayment 13-june-2017 1 #########\n"; $ret = array(); if (!is_null($app->request->getBody())) { include_once (_PRESTA_ROOT_DIR_."/modules/paypal/paypal.php"); //include_once (_PRESTA_ROOT_DIR_."/modules/cronpanier/cronpanier.php"); $json = json_decode($app->request->getBody(), true); \Stripe\Stripe::setApiKey("sk_test_key"); $token = $json['stripeToken']; $cart_id = $json['cart_id']; $panier = new Cart($cart_id); $montant = $panier->getOrderTotal(true, Cart::BOTH); $amount = $montant*100; $customer = new Customer($panier->id_customer); $context = Context::getContext(); $context->customer = $customer; $context->cart = $panier; Address::insertAdressDefault(); $customerAddresses = $customer->getAddresses($context->language->id); $customerAddresses = array_values($customerAddresses); if ((!isset($context->cart->id_address_delivery) || empty($context->cart->id_address_delivery)) || !Address::isCountryActiveById((int)$context->cart->id_address_delivery)) { $context->cart->id_address_delivery = (int)$customerAddresses[0]['id_address']; $update = 1; } if ((!isset($context->cart->id_address_invoice) || empty($context->cart->id_address_invoice)) || !Address::isCountryActiveById((int)$context->cart->id_address_invoice)) { $context->cart->id_address_invoice = (int)$customerAddresses[0]['id_address']; $update = 1; } /* Update cart addresses only if needed */ if (isset($update) && $update) { $context->cart->update(); } $module = new Paypal(); $authOk = false; if ($token) { // Create the charge on Stripe's servers - this will charge the user's card try { $charge = \Stripe\Charge::create(array( "amount" => $amount, // amount in cents, again "currency" => "eur", "source" => $token, "description" => "Pharmacie Printemps" )); $payment_method = 'Paiement par stripe'; $ret['status'] = 'success'; $ret['message'] = "Succes :".$id.":".$montant.":".$cart_id; $authOk = true; } catch (\Stripe\Error\ApiConnection $e) { $ret['status'] = 'error'; $ret['message'] = utf8_encode("TLS 1.2 est pas pris en charge. Vous aurez besoin de mettre   niveau votre int gration."); } catch(\Stripe\Error\Card $e) { // The card has been declined $ret['status'] = 'error'; $ret['message'] = utf8_encode("La carte est refus e."); } } else { $ret['status'] = 'error'; $ret['message'] = utf8_encode("Erreur : Erreur de commande, merci de r essayer."); } } else { $ret['status'] = 'error'; $ret['message'] = utf8_encode('Requ te invalide'); } if($authOk){ $txt .= "---- AUTH OK ---- \n"; $module->validateOrder($cart_id,2,$montant,$payment_method); }else{ $ret['message'] = utf8_encode('Erreur de validation de commande, merci de r essayer'); } echo json_encode($ret); $txt .= "\n\n\n\n\n".print_r($json, true)."\n\n\n\n\n"; $txt .= ">>>>>>>>> makeStripePayment END\n\n\n\n\n"; file_put_contents($myfile, $txt); }); 

В приведенном выше коде есть имя метода validateOrder которое ниже, если я удаляю этот порядок строк, который не вставляется в таблицу заказов, а также не отображается на панели администратора.

метод validateOrder

  public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $transaction = array(), $currency_special = null, $dont_touch_amount = false, $secure_key = false, Shop $shop = null) { if ($this->active) { // Set transaction details if pcc is defined in PaymentModule class_exists if (isset($this->pcc)) { $this->pcc->transaction_id = (isset($transaction['transaction_id']) ? $transaction['transaction_id'] : ''); } if (version_compare(_PS_VERSION_, '1.5', '<')) { parent::validateOrder( (int) $id_cart, (int) $id_order_state, (float) $amount_paid, $payment_method, $message, $transaction, $currency_special, $dont_touch_amount, $secure_key ); } else { parent::validateOrder( (int) $id_cart, (int) $id_order_state, (float) $amount_paid, $payment_method, $message, $transaction, $currency_special, $dont_touch_amount, $secure_key, $shop ); } if (count($transaction) > 0) { /*var_dump($transaction); die();*/ PayPalOrder::saveOrder((int) $this->currentOrder, $transaction); } $this->setPayPalAsConfigured(); } } 

Кто-нибудь сталкивается с той же проблемой?

Любая помощь будет оценена по достоинству.

Заранее спасибо.

Related of "Двойные / дублированные платежи Prestashop"