1
0
mirror of synced 2025-01-18 08:51:41 +03:00

Remove legacy code for updating orders by history associated with payments

This commit is contained in:
Dima Uryvskiy 2022-01-10 19:15:01 +03:00 committed by GitHub
parent f4c44d486c
commit 05a0f64a13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View File

@ -487,17 +487,6 @@ if (!class_exists('WC_Retailcrm_History')) :
}
}
if (isset($order['paymentType'])) {
if (!empty($options[$order['paymentType']])) {
$payment = WC_Payment_Gateways::instance();
$paymentTypes = $payment->payment_gateways();
if (isset($paymentTypes[$options[$order['paymentType']]])) {
$wcOrder->set_payment_method($paymentTypes[$options[$order['paymentType']]]);
}
}
}
if (isset($order['payments']) && !empty($order['payments'])) {
$payment = WC_Payment_Gateways::instance();
$paymentTypes = $payment->payment_gateways();
@ -742,6 +731,7 @@ if (!class_exists('WC_Retailcrm_History')) :
$paymentTypes = $payment->payment_gateways();
$payments = $order['payments'];
$paymentType = end($payments);
if (isset($options[$paymentType['type']]) && isset($paymentTypes[$options[$paymentType['type']]])) {
$wcOrder->set_payment_method($paymentTypes[$options[$paymentType['type']]]);
}

View File

@ -82,7 +82,7 @@ class WC_Retailcrm_History_Assembler
if ($change['field'] == 'payments.status') {
if ($change['newValue'] !== null) {
$orders[$change['order']['id']]['payment']['id']['status'] = self::newValue($change['newValue']);
$orders[$change['order']['id']]['payments']['id']['status'] = self::newValue($change['newValue']);
}
} else {
if (isset($fields['delivery'][$change['field']]) && $fields['delivery'][$change['field']] == 'service') {