Changeset 3440800
- Timestamp:
- 01/16/2026 07:22:20 AM (2 months ago)
- Location:
- ecommpay-payments/trunk
- Files:
-
- 6 edited
-
common/EcpCore.php (modified) (1 diff)
-
common/helpers/EcpGatewayAPIProtocol.php (modified) (5 diffs)
-
common/includes/EcpGatewayOrder.php (modified) (1 diff)
-
common/includes/filters/EcpAppendsFilters.php (modified) (2 diffs)
-
gateway-ecommpay.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ecommpay-payments/trunk/common/EcpCore.php
r3336019 r3440800 61 61 * @since 2.0.0 62 62 */ 63 public const WC_ECP_VERSION = '4.2. 0';63 public const WC_ECP_VERSION = '4.2.1'; 64 64 65 65 public const ECOMMPAY_PAYMENT_METHOD = 'ecommpay'; -
ecommpay-payments/trunk/common/helpers/EcpGatewayAPIProtocol.php
r3336019 r3440800 218 218 } 219 219 220 221 /** 222 * <h2>Appends ECOMMPAY Payment Page Avs zip.</h2> 223 * 220 /** 221 * <h2>Appends ECOMMPAY Payment Page AVS data (post code and street address).</h2> 222 * <p>Both AVS fields are added only if both values are present. 223 * If either field is missing, neither is sent to allow Payment Page to collect both.</p> 224 * 225 * @param array $values <p>Base array for appending data</p> 224 226 * @param EcpGatewayOrder $order <p>Order object.</p> 225 * @param array $values <p>Base array for appending data</p>226 227 * 227 228 * @return array Result of appending data as new array. 228 229 */ 229 public function append_avs_post_code( array $values, EcpGatewayOrder $order ): array { 230 $this->append_argument( 231 'avs_post_code', 232 wc_format_postcode( $order->get_billing_postcode(), $order->get_billing_country() ), 233 $values 230 public function append_avs_data( array $values, EcpGatewayOrder $order ): array { 231 $postcode = wc_format_postcode( $order->get_billing_postcode(), $order->get_billing_country() ); 232 $address = $order->get_billing_address(); 233 234 if ( $postcode && $address ) { 235 $this->append_argument( 'avs_post_code', $postcode, $values ); 236 $this->append_argument( 'avs_street_address', $address, $values ); 237 } 238 239 return $values; 240 } 241 242 /** 243 * @param array $values 244 * @param EcpGatewayOrder|null $order 245 * 246 * @return array 247 * @since 3.0.0 248 */ 249 public function append_card_operation_type( array $values, EcpGatewayOrder $order = null ): array { 250 $mode = ecommpay()->get_general_option( 251 EcpSettingsGeneral::PURCHASE_TYPE, 252 EcpSettingsGeneral::PURCHASE_TYPE_SALE 234 253 ); 235 236 return $values;237 }238 239 /**240 * <h2>Appends ECOMMPAY Payment Page Avs address.</h2>241 *242 * @param EcpGatewayOrder $order <p>Order object.</p>243 * @param array $values <p>Base array for appending data</p>244 *245 * @return array Result of appending data as new array.246 */247 public function append_avs_street_address( array $values, EcpGatewayOrder $order ): array {248 $this->append_argument( 'avs_street_address', $order->get_billing_address(), $values );249 250 return $values;251 }252 253 /**254 * @param array $values255 * @param EcpGatewayOrder|null $order256 *257 * @return array258 * @since 3.0.0259 */260 public function append_card_operation_type( array $values, EcpGatewayOrder $order = null ): array {261 $mode = ecommpay()->get_general_option( EcpSettingsGeneral::PURCHASE_TYPE,262 EcpSettingsGeneral::PURCHASE_TYPE_SALE );263 254 264 255 if ( $mode === EcpSettingsGeneral::PURCHASE_TYPE_AUTH && EcpModuleCapture::is_auto_capture_needed( $order ) ) { … … 537 528 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_BILLING_DATA, $values, $order ); 538 529 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_RECEIPT_DATA, $values, $order, true ); 539 $values = apply_filters( EcpAppendsFilters::ECP_APPEND_AVS_POST_CODE, $values, $order ); 540 541 return apply_filters( EcpAppendsFilters::ECP_APPEND_AVS_STREET_ADDRESS, $values, $order ); 530 531 return apply_filters( EcpAppendsFilters::ECP_APPEND_AVS_DATA, $values, $order ); 542 532 } 543 533 … … 579 569 'register' => true, 580 570 'type' => EcpGatewayRecurringTypes::AUTO, 581 'amount' => ecp_price_multiply( $amount, $order->get_currency() ),571 'amount' => ecp_price_multiply( $amount, $order->get_currency() ), 582 572 ]; 583 573 … … 790 780 'append_merchant_return_url' 791 781 ], 10, 2 ); 792 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_SUCCESS_URL, [ $this, 'append_redirect_success_url' ], 10, 2 ); 782 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_SUCCESS_URL, [ 783 $this, 784 'append_redirect_success_url' 785 ], 10, 2 ); 793 786 add_filter( EcpAppendsFilters::ECP_APPEND_REDIRECT_FAIL_URL, [ $this, 'append_redirect_fail_url' ], 10, 2 ); 794 787 add_filter( EcpAppendsFilters::ECP_APPEND_MERCHANT_CALLBACK_URL, [ $this, 'append_merchant_callback_url' ] ); … … 810 803 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ADDRESS, [ $this, 'append_customer_address' ], 10, 2 ); 811 804 add_filter( EcpAppendsFilters::ECP_APPEND_CUSTOMER_ZIP, [ $this, 'append_customer_zip' ], 10, 2 ); 812 add_filter( EcpAppendsFilters::ECP_APPEND_AVS_POST_CODE, [ $this, 'append_avs_post_code' ], 10, 2 ); 813 add_filter( EcpAppendsFilters::ECP_APPEND_AVS_STREET_ADDRESS, [ 814 $this, 815 'append_avs_street_address' 816 ], 10, 2 ); 805 add_filter( EcpAppendsFilters::ECP_APPEND_AVS_DATA, [ $this, 'append_avs_data' ], 10, 2 ); 817 806 add_filter( EcpAppendsFilters::ECP_APPEND_BILLING_DATA, [ $this, 'append_billing_data' ], 10, 2 ); 818 807 add_filter( EcpFilters::ECP_APPEND_BILLING_ADDRESS, [ $this, 'append_billing_address' ], 10, 2 ); -
ecommpay-payments/trunk/common/includes/EcpGatewayOrder.php
r3267715 r3440800 355 355 356 356 public function get_billing_address(): string { 357 return implode( ' ', [ $this->get_billing_address_1(), $this->get_billing_address_2() ] ); 357 return trim( implode( ' ', [ $this->get_billing_address_1(), $this->get_billing_address_2() ] ) ); 358 } 359 360 public function get_billing_postcode( $context = 'view' ): string { 361 return trim( parent::get_billing_postcode( $context ) ); 358 362 } 359 363 -
ecommpay-payments/trunk/common/includes/filters/EcpAppendsFilters.php
r3336019 r3440800 20 20 public const ECP_APPEND_BILLING_POSTAL = 'ecp_append_billing_postal'; 21 21 public const ECP_APPEND_GATEWAY_ARGUMENTS = 'ecp_append_gateway_arguments_'; 22 public const ECP_APPEND_AVS_STREET_ADDRESS = 'ecp_append_avs_street_address';23 22 public const ECP_APPEND_VERSIONS = 'ecp_append_versions'; 24 23 public const ECP_APPEND_RECURRING = 'ecp_append_recurring'; … … 38 37 public const ECP_APPEND_CUSTOMER_ZIP = 'ecp_append_customer_zip'; 39 38 public const ECP_APPEND_CUSTOMER_EMAIL = 'ecp_append_customer_email'; 40 public const ECP_APPEND_AVS_ POST_CODE = 'ecp_append_avs_post_code';39 public const ECP_APPEND_AVS_DATA = 'ecp_append_avs_data'; 41 40 public const ECP_APPEND_CARD_OPERATION_TYPE = 'ecp_append_card_operation_type'; 42 41 public const ECP_APPEND_FORCE_MODE = 'ecp_append_force_mode'; -
ecommpay-payments/trunk/gateway-ecommpay.php
r3336019 r3440800 5 5 * GitHub Plugin URI: 6 6 * Description: Easy payment from WooCommerce by different methods in single Payment Page. 7 * Version: 4.2. 07 * Version: 4.2.1 8 8 * License: GPL2 9 9 * License URI: https://www.gnu.org/licenses/gpl-2.0.html -
ecommpay-payments/trunk/readme.txt
r3336019 r3440800 4 4 Requires at least: 6.2 5 5 Tested up to: 6.7 6 Stable tag: 4.2. 06 Stable tag: 4.2.1 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.