Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: v5.12.0 - Add Cart/Checkout Blocks support (#614)
* update blocks support namespaces * Declare php-compatibility path & update minimum PHP version As per https://github.com/PHPCompatibility/PHPCompatibility#installation-in-a-composer-project-method-1 * use underscored IDs instead of dasherized IDs (follow WC convention) * use get_payment_method_data as method name for checkout block integrations * Add missing typehints * add configuration flags to payment method data * revert back to dasherized ids * Revert "revert back to dasherized ids" This reverts commit 3346fd4. * experiment with posted token & csc getters * Support getting payment tokens by core (woo) ID * Prepare checkout block payment tokens for payment * Add test_mode to block payment method data * Move test mode to flag" * Rename flag * Split logic from prepare_payment_token * Update phpdoc * Add payment gateway id to block data * Get customer facing variables instead of merchants * Add type to payment method block data * Add supported card types to block data * Add supported card types icons to block data * Add gateway icons to block data * Use raw icon url * Code style tweak * Add todos * Do not load legacy frontend js if blocks is active * Update changelog * Pass dasherized id as name in block fields * Update id/name dasherization * Allow filtering gateway payment data * Add notices when a plugin is not cart/checkout block compatible * Add missing since tags * Remove todos * Use method title in icon alt * Line tweak * Update admin notice handling for blocks * Update notices text * Update notices text * Plugin name in bold * Plugin name in bold * Remove redudant methods to get posted csc or token * Attach apple pay data to block payment method data * expose configured card types (identifiers) to blocks * Add apple pay variables to payment method data * Remove available card types * Add Google Pay data to block payment method data * Edit phpdocs * Update incompatible block notice * Update incompatible block notice IDs * Update ext checkout frontend init logic * Add external checkout flags * Add todo note * Add helper methods to restore cart/checkout shortcodes * Fix page id * Rework blocks admin notices * Update blocks cta button class and add line break * Fix wp update post * Update restore_page_shortcode * Update phpdoc * Update alert message when restoring shortcodes * Update changelog * Add warning if the shortcode restoration is unsuccessful * Add translator notes * Add more detailed error messages if shortcode restoration fails * Fix framework path * Do not call methods that invoke assert() when building block payment data * Do not call methods that invoke assert() when building block payment data * Add eCheck icon support to block data * Add sample echeck to payment method payload * Add filter for block checkout gateway icons * Add payment gateway defaults * Add help tip icon to payment method data * Update Apple / Google pay payment method data * Add merchant name to Apple pay data * Add block integration placeholders * Document filter * Normalize gateway defaults in payment data * Prepare payment data from block checkout (tokenize flag, existing token) * Add functions to External Checkout to determine block support * Init external checkout frontend if does not support blocks * Update payment method data payload based on external checkout supports * Add inline comments * Pass supported external checkout features from constructor * By default external checkout blocks compatibility follows main plugin * Remove cart/checkout CTA to revert to shortcode * Update button label * Allow filtering the main script handle and url * Update phpdocs * Add get_main_script_stylesheet_url as well * Add Block_Integration trait functions to enqueue and filter dependencies * Enforce types on filters * Fix accidental comma instead of period in string concat * Update filter names * Update filter names * Should use unique gateway in filter names * Use string interpolation in filter names * Update Gateway_Checkout_Block_Integration * Replace is enabled with is available in is active block function * No need for fully qualified namespaces in phpdocs * Add context flag to payment sent via shortcode checkout * Update phpdocs * Move script and stylsheet dependencies to property so it can be extended before filtered * Add utility functions to add dependencies to the block integration handler * Add sv_wc_is_block_checkout helper flag when preparing payment data for processing * Add logging_enabled flag to payment method data * Pass time/date format in payment data payload * Pass time/date format in payment data payload * optionally pass additional data in get payment method data in block * Add built in filter callback to override or extend payment method data * Allow null additional data * Nullable arg * Cast nullable arg as array * Remove get_payment_method_data arg * Normalize enabled card types for blocks * Add helper method to convert payment method data to json object * rename method * Use wp parse args to parse external checkout supported features * Add echeck images * Pass echeck images instead of a single one * Add echeck sprite to sample echeck images array * Fix filename typo * Rename echeck files * Update filter name * Normalize payment method context between blocks and shortcode * Update sample check images remove text * Just use one sample echeck image * Fix sample check asset url * Add debug mode to payload * Add log js data nonce * Add AJAX logging for gateway blocks * Fix ajax callback name and send response when log request * Cast request and response to array * Use null coalesce to avoid errors when grabbing ext checkout supported features * Update main script URL and stylsheet defaults * Fix url prefix * Fix url prefix * Add basic gateway config values and move flags to helper method * Add inline comments * Make sure gateway icons are filterable * Use enabled card types for icons * Move google and apple pay config to helper methods * Ensure request/response are non-empty before logging * Allow setting log type in log_api_request * Account for legacy types * Update block incompatibility notice copy * Edit shortcode ref * Open link to docs in new page * Add i18n param to payment data * Update changelog * Use new function/filter for gateway localized params * Add generic card type invalid message * Just card without type * Add flags.detailed_decline_messages_enabled in payment data payload * Do not load gateway assets when block is in use * Do not mark method as internal * Allow loading assets on alt checkout pages * Do not load payment form when checkout block is in use in checkout page * Cannot use is_page args when init payment form * Update phpdocs * Try to grab any error notice when returning a process payment failure * Add notices as user message regardless of error if debug checkout * Ensure to parse array before sent to message string * Remove extra newlines * expose supported card types to blocks * Move debug checkout condition check one up to avoid passing debug log accidentally * convert XML chars to entities * Ensure gateway supports card types before getting available ones * Implode notice messages in newlines * Spacing * Typo in var name * Update debug mode methods and payment data * Simplify debug mode * Rename debug mode value in payment data * Update inline comment * Bail and send response message when logging in blocks * Send error message with invalid nonce. * Use exceptions in log request * Check for debug off * Build assets * ensure only card type keys are used for supported cards * Update convention for block integration names/identifiers * Fix get name/id * Prepend with wc- for consistency * Use the plugin dash id for default css and script names * Implement BLock_Integration_Trait::initialize default method * Update since tag * Update example * do not set script version if SCRIPT_DEBUG true * Add helper method to prepare log data * Update method paran name * Rename method * Add missing since tags * should use dasherized id for main script url * Update sprintf string for readability * Also enqueue stylesheet via wp_enqueue_style * Update wp_enqueue_block_style args * Expand phpdocs in integration trait * Use time() when script debug enabled to burst script/styles cache * Check for explicit true * Add jquery dependency * Revert * Also update maybe_enqueue_styles_scripts to burst caches * Update should_render_js_on_checkout_page to match should_enqueue_gateway_assets * Fix method declaration type * Code style * Detect if current page has shortcode * Burst script caches for gateway scripts when using any debug mode * Rename to assets version * Update changelog * Use get_plugin to get plugin class * Add translator context * Add translator context * Fix Block_Integration_Trait * Update phpdoc * Rework checkout block logging * Update AJAX logging in blocks * Add basic debug logging via constants * Do not send log type as log id * Add get_ajax_log_data helper * Fix filter name * Formatting * Add AJAX logging also in the standard Block Integration abstract * Move get_ajax_log_data to trait * Move ajax hooks to trait method * Send request type when logging * Update changelog * Update phpdocs and namespace refs * Revert "Update phpdocs and namespace refs" This reverts commit 8b7102d. * Document request/response could be stdClass * Add flag for settings inherited * Add flag whether cart has subscription * Also add flag if cart has renewal * Pass tokenization_forced to payment data * Update namespace refs * Add action to allow third parties hooking in the transaction response * Update changelog * Update supported features in ext checkout handling * Add note * Version: v5.12.0 * Update ext checkout supported features parsing * Version: v5.12.0 --------- Co-authored-by: Illimar Tambek <[email protected]> Co-authored-by: Fulvio Notarstefano <[email protected]>
- Loading branch information