修复两个问题
This commit is contained in:
@@ -386,6 +386,16 @@ class Gateway {
|
||||
// 用户可能重复付款,不能静默 ACK 为已正确同步。
|
||||
if (in_array($current, ['paid', 'delivered', 'completed'], true)) {
|
||||
$stored_transaction = sanitize_text_field((string) ($order['payment_transaction_id'] ?? ''));
|
||||
if (sanitize_key((string) ($order['product_type'] ?? '')) === \AKSRT\Core\DomainModel::ORDER_PRODUCT_RECHARGE) {
|
||||
if ($stored_transaction !== '' && !hash_equals($stored_transaction, $transaction_id)) {
|
||||
return false;
|
||||
}
|
||||
return $repo->update_status($order_number, Order::STATUS_PAID, [
|
||||
'payment_method' => $gateway_id,
|
||||
'payment_transaction_id' => $transaction_id,
|
||||
'note' => __('支付网关回调补充确认到账。', 'aksrt'),
|
||||
]);
|
||||
}
|
||||
return $stored_transaction !== '' && hash_equals($stored_transaction, $transaction_id);
|
||||
}
|
||||
// 只允许从未支付态完成
|
||||
|
||||
Reference in New Issue
Block a user