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

Only include digital and physical products in `{payment_lines_name}` merge tag #184

Closed rvdsteege closed 2 months ago

rvdsteege commented 2 months ago

I just added the {payment_lines_name} to the description of a WooCommerce setting in https://github.com/pronamic/pronamic-pay/issues/100 and noticed that this tag includes payment lines of all types — including discounts, fees, shipping and taxes. I think we're not interested in these types in payment descriptions?

For example, the payment description of a WooCommerce order now results in (where 'Vast Tarief' refers to shipping costs):

Bestelling {order_number} voor {payment_lines_name} Bestelling 43801 voor Simple product, Vast Tarief

https://github.com/pronamic/wp-pay-core/blob/dc45e1a5241205af4de0eca6a84f79a655c50411/src/Payments/PaymentLineType.php

remcotolsma commented 2 months ago

One user will like it, another will not. I don't think it has been used enough yet to make a good choice. It can be useful for a seller if they sell product A and the customer can choose from different shipping methods (pick up at the online store, normal via PostNL, urgent via courier) this can now be visible in the description for both the customer and the seller. I'm leaning more towards simplicity in the code for now. Wait and see if Pronamic Pay users will stumble over this?