Commit Graph

8 Commits

Author SHA1 Message Date
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 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 9d220450f0 Fix unit test 2016-06-01 12:39:52 +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 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 8f27a3b3af Full set of tests for the payment token API 2016-03-01 11:49:40 -08:00