← All changes
|
includes/Services/Settings/Payment_Gateways_Section.php
+2
-14
1.10.22
→
1.10.17
View file →
| @@ -7,9 +7,8 @@ | ||
| 7 | 7 | |
| 8 | 8 | namespace WCPOS\WooCommercePOS\Services\Settings; |
| 9 | 9 | |
| 10 | 10 | use WC_Payment_Gateways; |
| 11 | -use WCPOS\WooCommercePOS\Payments\Gateway_Contract; | |
| 12 | 11 | |
| 13 | 12 | /** |
| 14 | 13 | * The Payment Gateways Settings Section. |
| 15 | 14 | * |
| @@ -106,10 +105,8 @@ | ||
| 106 | 105 | |
| 107 | 106 | // Gateways that represent deferred/unverified payment default to on-hold. |
| 108 | 107 | $on_hold_gateways = array( 'bacs', 'cheque' ); |
| 109 | 108 | |
| 110 | - $contract = new Gateway_Contract(); | |
| 111 | - | |
| 112 | 109 | // loop through installed gateways and merge with saved settings. |
| 113 | 110 | foreach ( $installed_gateways as $id => $gateway ) { |
| 114 | 111 | // sanity check for gateway class. |
| 115 | 112 | if ( ! is_a( $gateway, 'WC_Payment_Gateway' ) || 'pre_install_woocommerce_payments_promotion' === $id ) { |
| @@ -120,10 +117,10 @@ | ||
| 120 | 117 | |
| 121 | 118 | $response['gateways'][ $id ] = array_replace_recursive( |
| 122 | 119 | array( |
| 123 | 120 | 'id' => $gateway->id, |
| 124 | - 'title' => $contract->get_display_title( $gateway ), | |
| 125 | - 'description' => $contract->get_display_description( $gateway ), | |
| 121 | + 'title' => $gateway->title, | |
| 122 | + 'description' => $gateway->description, | |
| 126 | 123 | 'enabled' => false, |
| 127 | 124 | 'order' => 999, |
| 128 | 125 | 'order_status' => $default_status, |
| 129 | 126 | ), |
| @@ -128,17 +125,8 @@ | ||
| 128 | 125 | 'order_status' => $default_status, |
| 129 | 126 | ), |
| 130 | 127 | $gateways_settings['gateways'][ $id ] ?? array() |
| 131 | 128 | ); |
| 132 | - | |
| 133 | - if ( ! is_string( $response['gateways'][ $id ]['title'] ) || '' === trim( $response['gateways'][ $id ]['title'] ) ) { | |
| 134 | - $response['gateways'][ $id ]['title'] = $contract->get_display_title( $gateway ); | |
| 135 | - } | |
| 136 | - | |
| 137 | - // A saved empty string is a deliberate blank and is kept. | |
| 138 | - if ( ! is_string( $response['gateways'][ $id ]['description'] ) ) { | |
| 139 | - $response['gateways'][ $id ]['description'] = $contract->get_display_description( $gateway ); | |
| 140 | - } | |
| 141 | 129 | } |
| 142 | 130 | |
| 143 | 131 | /** |
| 144 | 132 | * Filters the payment gateways settings. |