Commit Graph

18 Commits

Author SHA1 Message Date
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Justin Shreve fb124232cf Update Payment Tokens to follow the same pattern for custom data as other object types.
Payment tokens was introduced in 2.6 and was updated to use the new CRUD code while some of the CRUD system was still in flux.

While most things were correct, the prop handling for custom fields (like a card's last 4 digits) were directly calling meta functions, instead of delegating to the data store/parent.

This PR moves these props to `extra_data` and follows the same pattern as product types or order items. It also updates some version tags to 3.0.0. Finally, it adds an additional test for saving meta after a create which looks like it was lacking.

To Test:
* Run `phpunit`.
* Go to the "My Account" tab and add a new payment method. You need a payment gateway that supports this, like Simplify.
* Test the add a payment method flow.
* Make a test purchase using the saved payment method.
2017-03-14 12:33:35 -07:00
Justin Shreve 32651f638c When updating payment tokens, only update the props that have changed + fire off a hook of the changed props. 2017-01-25 11:05:54 -08:00
Mike Jolley 086d8bce1d Fix is_callable 2016-11-25 14:48:20 +00:00
Mike Jolley 4ca49ba999 Fix tests 2016-11-23 16:27:18 +00:00
Justin Shreve 944e5d658b Handle feedback 2016-11-14 09:08:46 -08:00
Justin Shreve 370166a6b0 Payment Token Data Store 2016-11-14 06:20:41 -08:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Mike Jolley 9c7abaedcb Fixed unit tests 2016-06-22 12:29:23 +01:00
Mike Jolley 9d220450f0 Fix unit test 2016-06-01 12:39:52 +01:00
Mike Jolley 854793e5ea Fix unit test by using available gateway 2016-05-27 11:29:19 +01:00
Mike Jolley 2fec0f425a Remove namespaces from tests for 5.2 support 2016-03-23 12:14:13 +00:00
Justin Shreve 1d35fd6d73 Convert WC_Payment_Tokens (and CC/eCheck tokens) to use the new WC_Data and meta handling code. 2016-03-21 11:06:17 -07:00
Justin Shreve 5dbfc7ae16 Fix Payment Token 'set default' methods. Makes sure we are using the user ID of the payment token, and not the current user.
Also makes sure to properly unset other tokens when a new one is set as default. Finally, we make sure that a user is always set in our payment token tests (which was broken in some WP versions which alerted us to some broken tests).
2016-03-14 09:41:37 -07:00
Justin Shreve 49c45c6dc1 Make sure the is_default/default token ability works correctly. Also adds a new method for getting a users default token. Fixes up some docblocks. 2016-03-01 11:49:42 -08:00
Justin Shreve c0b74296ff * Remove WC_Payment_Gateway_Form in favor of having a Payment_Gateway_CC and Payment_Gateway_eCheck
* Fix up some comments to match other comments in the WC code base
* Add some missing esc_* functions
* Add a gateway filter to get_customer_tokens + a test for it
2016-03-01 11:49:42 -08:00
Justin Shreve 5d8967c7d7 Prepare a list of payment methods for output on the payment methods "my account" page. 2016-03-01 11:49:40 -08:00
Justin Shreve 8f27a3b3af Full set of tests for the payment token API 2016-03-01 11:49:40 -08:00