Closed remcotolsma closed 11 months ago
Related to:
Payment method-specific response parameters ¶ If the payment has been created with a method, or if the customer selected a method in the payment method selection screen, a details object becomes available on the payment object. This object contains detail fields specific to the selected payment method.
Source: https://docs.mollie.com/reference/v2/payments-api/get-payment
We use the details for example in:
Payment details class could extend https://github.com/pronamic/wp-mollie/blob/192e04ade34b0725b0f741187be22e955494ad82/src/ObjectAccess.php to make it easy and flexibel.
Other option is to introduce different classes for each method PaymentDetailsIDeal
, PaymentDetailsBancontact
, etc. How to improve?
Discussed at HQ and decided on extending ObjectAccess
.
https://php.watch/versions/8.2/dynamic-properties-deprecated
https://github.com/pronamic/wp-mollie/blob/a6e16581d7f64f6be5d823ad8c07cae00d121c95/src/PaymentDetails.php#L25-L39