← All changes
|
app/Modules/PaymentMethods/Core/AbstractPaymentGateway.php
+11
-2
1.6.3
→
1.6.5
View file →
| @@ -67,10 +67,18 @@ | ||
| 67 | 67 | if (isset($gatewaySettings['checkout_logo']) && !empty($gatewaySettings['checkout_logo'])) { |
| 68 | 68 | $meta['logo'] = $gatewaySettings['checkout_logo']; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - if (isset($gatewaySettings['checkout_instructions']) && !empty($gatewaySettings['checkout_instructions'])) { | |
| 72 | - $meta['instructions'] = $gatewaySettings['checkout_instructions']; | |
| 71 | + if (!empty($gatewaySettings['checkout_instructions'])) { | |
| 72 | + $instructionsText = trim(wp_strip_all_tags(html_entity_decode($gatewaySettings['checkout_instructions'], ENT_QUOTES))); | |
| 73 | + // Nbsp survives strip_tags/html_entity_decode as a literal | |
| 74 | + // non-breaking space, so a rich-text editor can save "<p> </p>" | |
| 75 | + // and still look non-empty to a bare !empty() check. | |
| 76 | + $instructionsText = str_replace("\xC2\xA0", '', $instructionsText); | |
| 77 | + | |
| 78 | + if (trim($instructionsText) !== '') { | |
| 79 | + $meta['instructions'] = $gatewaySettings['checkout_instructions']; | |
| 80 | + } | |
| 73 | 81 | } |
| 74 | 82 | |
| 75 | 83 | if ($key !== '') { |
| 76 | 84 | return Arr::get($meta, $key, ''); |
| @@ -317,8 +325,9 @@ | ||
| 317 | 325 | if ($oldGateway && $oldGateway->has('subscriptions') && $oldGateway->subscriptions) { |
| 318 | 326 | $cancelResult = $oldGateway->subscriptions->cancel($subscription->vendor_subscription_id, [ |
| 319 | 327 | 'subscription_id' => $subscription->id, |
| 320 | 328 | 'parent_order_id' => $subscription->parent_order_id, |
| 329 | + 'mode' => $subscription->order ? $subscription->order->mode : 'current', | |
| 321 | 330 | ]); |
| 322 | 331 | if (is_wp_error($cancelResult)) { |
| 323 | 332 | fluent_cart_error_log( |
| 324 | 333 | 'Failed to cancel vendor subscription during conversion to manual', |