Square returning error with WooCommerce - wordpress

I've installed the WooCommerce Square plugin to enable payments to our Square account but I get this error at the checkout when trying to pay with a credit card:
Array(
[0] => stdClass Object
(
[category] => INVALID_REQUEST_ERROR
[code] => MISSING_REQUIRED_PARAMETER
[detail] => Missing required parameter.
[field] => card_nonce
)
)
Any ideas?

Related

Coinbase Commerce Woocommerce Error response from API: Required parameter missing: pricing_type

Integrated Coinbase Commerce to my Wordpress Woocommerce website and everything was working just fine since yesterday.
When customer click on "Proceed to Coinbase" button to finish a purchase, website says "Error processing checkout. Please try again."
I logged Coinbase Commerce Plugin and I can see that error is:
2018-09-25T10:57:06+00:00 INFO Coinbase Request Args for charges: Array
(
[name] => DomainName
[description] => some description
[pricing_type] => fixed_price
[local_price] => Array
(
[amount] => 3000.00
[currency] => USD
)
[metadata] => Array
(
[order_id] => 438
[order_key] => wc_order_5ba994a3a976c
)
[redirect_url] => https://example.com/checkout/order-received/438/?key=wc_order_5ba994a3a976c
)
2018-09-25T10:57:07+00:00 INFO Error response from API: Required parameter missing: pricing_type
I don't know what to do, what do I need to change to fix that..

Get Track detail in gracenote API

I am using grace note API to list tracks and albums.
Can anyone please let me know how Can I get track details such as link?
I am getting track_gnid
below is the response to $results = $api->searchTrack("Kings Of Convenience", "Riot On An Empty Street", "Homesick");
[tracks] => Array
(
[0] => Array
(
[track_number] => 1
[track_gnid] => 59247313-E198021B46C38679362C35619E93396B
[track_title] => Homesick
[track_artist_name] => Kings Of Convenience
[mood] => Array
(
)
[tempo] => Array
(
)
)
)
I want to get track link or anything like that

Custom Taxonomy Template won't show any menus

This is how I can start describing this, it's a very strange error that maybe something else but this is the first symptom I have.
I have a custom template[taxonomy-location_types.php] that shows, a custom post type [locations] by it's custom taxonomy[location-types].
If you visit the home page you will see a menu editorial, travel, etc.
Now if you look here on this taxonomy page
The menu is gone, there are other queries that aren't firing but I'm focussing on this as a primary issue.
I have generated output from nav-menu-template.php like so:
if ( $menu && !is_wp_error($menu) && !isset($menu_items) )
{
write_log($menu);
$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );
write_log($menu_items);
}
and I get this:
[31-Aug-2017 15:27:52 UTC] WP_Term Object
(
[term_id] => 2
[name] => Header Menu
[slug] => header-menu
[term_group] => 0
[term_taxonomy_id] => 2
[taxonomy] => nav_menu
[description] =>
[parent] => 0
[count] => 6
[filter] => raw
)
[31-Aug-2017 15:27:52 UTC] Array
(
)
[31-Aug-2017 15:27:52 UTC] WP_Term Object
(
[term_id] => 3
[name] => Footer One
[slug] => footer-one
[term_group] => 0
[term_taxonomy_id] => 3
[taxonomy] => nav_menu
[description] =>
[parent] => 0
[count] => 5
[filter] => raw
)
[31-Aug-2017 15:27:52 UTC] Array
(
)
So it sees the menu but for some reason return no items in either menu.
I have turned off all plugins and still get the same result, I have also eliminated all other queries on this page to see if there was conflict and this still this happens.
Any insight on this one would be great not sure where to look next for issues.
Chalk another one up for RTFM, I had a pre_get_posts hook altering the query and I didn't ensure that the query it was altering was just the $query->is_main_query() because strangely enough this alteration was getting into the nav_menu query.
query monitor is now my new best friend.

WooCommerce API, Variant Sku breaks import

I am importing products with Variations and each variation having its own SKU. However if I include a 'sku' with a Variation, it does not add them, it adds one Variation as 'default value' and not the individual ones. If I exclude the 'sku' field then it works as expected. Yet WooCommerce documentation shows that Variants have a field of 'sku'.
This is what I am sending (With the PHP api handler):
[0] => Array
(
[sku] => BH2057A
[regular_price] => 2.99
[stock_quantity] => 29
[in_stock] => 1
[managing_stock] => 1
[attributes] => Array
(
[0] => Array
(
[name] => Alphabet
[option] => A
)
)
)
This is the variant for 'A', it goes to 'Z'. The attribute is added on the product fine. As I say this works when I do not include the sku line, but breaks when I include it.
Anyone know whats wrong?

How are Wordpress Dynamic Sidebar Widgets rendered?

I have been reading through the Wordpress Source, trying to get a better understanding of how dynamic sidebars are rendered.
However, I am hitting a sticking point...
894 | do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] );
I can't find where add_action('dynamic_sidebar', ... ) is defined. Without that part, I am sort of lost in what happens.
See the code here:
https://github.com/WordPress/WordPress/blob/b7c13e27c255e1fc1f03ab2ab432f1652a0ac212/wp-includes/widgets.php#L894
And to give more context, I am trying to figure out how to grab an array of widgets from a specific sidebar, and from there, I need to know how would you render each widget within that array.
I need finer control than dynamic_sidebar(...); gives me
Well, that specific line permits you to access each registered Widget properties, and it's used like:
<?php
/* Plugin Name: Test registered widgets */
add_action( 'dynamic_sidebar', 'sidebar_widgets_so_18666065' );
/**
* As this is an action hook, we don't return nothing
* use the passed values to do your stuff
*/
function sidebar_widgets_so_18666065( $registered_widget )
{
# Each registered widget passes the following array
/*
$registered_widget = Array
(
[name] => Meta
[id] => meta-2
[callback] => Array
(
[0] => WP_Widget_Meta Object
(
[id_base] => meta
[name] => Meta
[widget_options] => Array
(
[classname] => widget_meta
[description] => Log in/out, admin, feed and WordPress links
)
[control_options] => Array
(
[id_base] => meta
)
[number] => 2
[id] => meta-2
[updated] =>
[option_name] => widget_meta
)
[1] => display_callback
)
[params] => Array
(
[0] => Array
(
[number] => 2
)
)
[classname] => widget_meta
[description] => Log in/out, admin, feed and WordPress links
)
*/
}
Relevant search query at WordPress Answers.

Resources