Skip to content

Commit e53c477

Browse files
authored
Add get_icon_url() to payment method classes (#4571)
* Add base get_icon_url() to prevent the Call to an undefined method error
1 parent e0d8375 commit e53c477

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* Fix - Handle missing customer when calling payment_methods API
3939
* Dev - Fix some e2e issues: timing, optional flows, and WooCommerce RC support
4040
* Fix - Reduce number of calls to Stripe payment_methods API
41+
* Fix - Add `get_icon_url()` to Payment Method base class
4142

4243
= 9.7.1 - 2025-07-28 =
4344
* Add - Add state mapping for Lithuania in express checkout

includes/payment-methods/class-wc-stripe-upe-payment-method.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ public function get_icon() {
235235
return apply_filters( 'woocommerce_gateway_icon', isset( $icons[ $this->get_id() ] ) ? $icons[ $this->get_id() ] : '', $this->id );
236236
}
237237

238+
/**
239+
* Gets the payment method's icon url.
240+
* Each payment method should override this method to return the icon url.
241+
*
242+
* @return string The icon url.
243+
*/
244+
public function get_icon_url() {
245+
return '';
246+
}
247+
238248
/**
239249
* Returns boolean dependent on whether payment method
240250
* can be used at checkout

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
147147
* Fix - Handle missing customer when calling payment_methods API
148148
* Dev - Fix some e2e issues: timing, optional flows, and WooCommerce RC support
149149
* Fix - Reduce number of calls to Stripe payment_methods API
150+
* Fix - Add `get_icon_url()` to Payment Method base class
150151

151152
[See changelog for full details across versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)