pronamic / wp-pay-core

Core components for the WordPress payment processing library. This library is used in the WordPress plugin Pronamic Pay: https://www.pronamicpay.com/, but also allows other plugin developers to set up a payment plugin.
https://www.wp-pay.org/
GNU General Public License v3.0
27 stars 3 forks source link

Enrich payment method object with description and images #173

Closed remcotolsma closed 5 months ago

remcotolsma commented 5 months ago

https://github.com/pronamic/wp-pay-core/blob/4f25fdf6f528448c21bd523abca9f041af09d81f/src/Core/PaymentMethod.php#L15-L61

https://github.com/pronamic/wp-pay-core/blob/4f25fdf6f528448c21bd523abca9f041af09d81f/src/Plugin.php#L296-L346

In the WooCommerce extension we sometimes have a description and icon defined:

https://github.com/pronamic/wp-pronamic-pay-woocommerce/blob/184e2062c1edff8b490f6cfd0ac8366085fc7016/src/Extension.php#L205-L523

$payment_method_ideal = new PaymentMethod( PaymentMethods::IDEAL );
$payment_method_ideal->name = \__( 'iDEAL', 'pronamic-pay' );
$payment_method_ideal->description = \__( 'With iDEAL you can easily pay online in the secure environment of your own bank.', 'pronamic-pay' );
$payment_method_ideal->images = [
    'wc-51x32' => __DIR__ . '',
];