Changeset 3471053
- Timestamp:
- 02/27/2026 12:09:36 PM (4 weeks ago)
- Location:
- ecommpay-payments/trunk
- Files:
-
- 4 edited
-
common/EcpCore.php (modified) (1 diff)
-
common/includes/EcpGatewayOrder.php (modified) (3 diffs)
-
gateway-ecommpay.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ecommpay-payments/trunk/common/EcpCore.php
r3459640 r3471053 61 61 * @since 2.0.0 62 62 */ 63 public const WC_ECP_VERSION = '4.2. 3';63 public const WC_ECP_VERSION = '4.2.4'; 64 64 65 65 public const ECOMMPAY_PAYMENT_METHOD = 'ecommpay'; -
ecommpay-payments/trunk/common/includes/EcpGatewayOrder.php
r3449399 r3471053 50 50 51 51 /** 52 * Payment statuses that require creating a new payment_id. 53 */ 54 private const STATUSES_REQUIRING_NEW_PAYMENT_ID = [ 55 EcpGatewayPaymentStatus::DECLINE, 56 EcpGatewayPaymentStatus::EXPIRED, 57 EcpGatewayPaymentStatus::INTERNAL_ERROR, 58 EcpGatewayPaymentStatus::EXTERNAL_ERROR, 59 ]; 60 61 /** 52 62 * @var ?EcpGatewayPayment 53 63 */ … … 111 121 */ 112 122 public function create_payment_id(): string { 113 $embeddedModePaymentId = $this->getEmbeddedModePaymentId(); 114 $paymentId = $embeddedModePaymentId ? : generateNewPaymentId($this); 123 if ( $embeddedModePaymentId = $this->getEmbeddedModePaymentId() ) { 124 $paymentId = $embeddedModePaymentId; 125 } else { 126 // Check if we can reuse existing payment_id first. 127 if ( $reusablePaymentId = $this->get_reusable_payment_id() ) { 128 ecp_get_log()->info( 129 sprintf( 130 __( 'Reusing existing payment ID %s (status: %s)', 'woo-ecommpay' ), 131 $reusablePaymentId, 132 $this->get_ecp_status() 133 ) 134 ); 135 return $reusablePaymentId; 136 } 137 $paymentId = generateNewPaymentId( $this ); 138 } 115 139 116 140 $this->set_payment_id( $paymentId ); … … 121 145 122 146 return $paymentId; 147 } 148 149 private function get_reusable_payment_id(): ?string { 150 $existing_payment_id = $this->get_payment_id(); 151 152 if ( ! $existing_payment_id ) { 153 return null; 154 } 155 156 $current_status = $this->get_ecp_status(); 157 158 if ( in_array( $current_status, self::STATUSES_REQUIRING_NEW_PAYMENT_ID, true ) ) { 159 return null; 160 } 161 162 return $existing_payment_id; 123 163 } 124 164 -
ecommpay-payments/trunk/gateway-ecommpay.php
r3459640 r3471053 5 5 * GitHub Plugin URI: 6 6 * Description: Easy payment from WooCommerce by different methods in single Payment Page. 7 * Version: 4.2. 37 * Version: 4.2.4 8 8 * License: GPL2 9 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -
ecommpay-payments/trunk/readme.txt
r3459640 r3471053 4 4 Requires at least: 6.2 5 5 Tested up to: 6.9 6 Stable tag: 4.2. 36 Stable tag: 4.2.4 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.