Skip to content

Commit 67ead54

Browse files
committed
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 e61d788 commit 67ead54

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
@@ -33,6 +33,7 @@
3333
* Update - Removes the ability to change the title for the Optimized Checkout payment element, as it is now set to "Stripe" by default
3434
* Fix - Handle missing customer when calling payment_methods API
3535
* Fix - Reduce number of calls to Stripe payment_methods API
36+
* Fix - Add `get_icon_url()` to Payment Method base class
3637

3738
= 9.7.1 - 2025-07-28 =
3839
* 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
@@ -142,6 +142,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
142142
* Add - Introduces a new inbox note to promote the Optimized Checkout feature on version 9.8 and later
143143
* Tweak - Use wp_ajax prefix for its built-in security for Add Payment Method action
144144
* Update - Removes the ability to change the title for the Optimized Checkout payment element, as it is now set to "Stripe" by default
145+
* Fix - Add `get_icon_url()` to Payment Method base class
145146

146147
**Internal Changes and Upcoming Features**
147148

0 commit comments

Comments
 (0)