After an inspection of the plugin code i probably found what can cause the problem of the order status pending.
SOLUTION:
In the file “wc-satispay.php” in “function gateway_api()” the line below marked up in bold is missing and it is required.
______________________________________________________________________________________
Dopo un’ispezione al codice del plugin probabilmente ho trovato cosa causa il problema dell’ordine che rimane nello stato PENDING.
SOLUZIONE:
Nel file “wc-satispay.php” la funzione “function gateway_api()” la linea qui giù in grassetto manca ed è necessaria
public function gateway_api() {
switch($_GET[‘action’]) {
case ‘redirect’:
$payment = \SatispayGBusiness\Payment::get($_GET[‘payment_id’]);
$order = new WC_Order($payment->metadata->order_id);
if ($payment->status === ‘ACCEPTED’) {
$order->payment_complete($payment->id);
header(‘Location: ‘.$this->get_return_url($order));
} else {
\SatispayGBusiness\Payment::update($payment->id, array( ‘action’ => ‘CANCEL’ ));
header(‘Location: ‘.$order->get_cancel_order_url_raw()); }
break;
case ‘callback’:
$payment = \SatispayGBusiness\Payment::get($_GET[‘payment_id’]);
$order = new WC_Order($payment->metadata->order_id);
if ($order->has_status(wc_get_is_paid_statuses())) {
exit;
}
if ($payment->status === ‘ACCEPTED’) {
$order->payment_complete($payment->id);
}
break;
}
}
I tried to pay an order and it works! The order status changed from ‘Pending Payment’ to ‘Processing’.
______
Ho provato a pagare un ordine e funziona correttamente! Lo stato dell’ordine è passato da ‘In attesa di pagamento’ a ‘In lavorazione’.
I tried to pay an order with a Satispay account with zero credit, satispay refused the transaction and the order changed from ‘Pending Payment’ to ‘Cancelled’
______
Ho provato a pagare un ordine con un account Satispay senza credito, Satispay ha rifiutato la transazione e lo stato dell’ordine è passato da ‘in attesa di pagamento’ a ‘cancellato’.