pronamic / wp-pronamic-pay-mollie

Mollie driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/mollie/
6 stars 1 forks source link

Test get Mollie Customer ID for payment #6

Closed remcotolsma closed 2 years ago

remcotolsma commented 2 years ago

We currently have a test in this library with which we test whether the search for a Mollie customer ID for a Pronamic Pay payment goes well.

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/141a1d555ecac81491d942f889972b8bd8d88a95/tests/src/GatewayTest.php#L238-L316

The test where the $user_id = 1, $subscription_customer_id = null, $first_payment_customer_id = 'cst_8wmqcHMN4U_first' and $expected = 'cst_8wmqcHMN4U_first' currently fails.

I think this behavior has changed because we changed the implementation of get_customer_id_for_subscription( Subscription $subscription ):

https://github.com/pronamic/wp-pronamic-pay-mollie/blob/29070a8f9fb2a071d48abecb36205be71c301487/src/Gateway.php#L554-L576

In the current version we no longer look at the 'first' payment of a subscription, the Mollie customer ID and the Mollie mandate ID are simply stored within the subscription metadata.

Therefore, we think that this test case is no longer relevant for now, if it later turns out to be the case, we can revise this issue.

remcotolsma commented 2 years ago

Fixed in https://github.com/pronamic/wp-pronamic-pay-mollie/commit/d2b3c257819a12b87b8d7d0d6073bbd4fe2f611e.