diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
commit | 10ef81bf85ad0a4bad0d204838e14c99ca2526f7 (patch) | |
tree | b4bb36a326d41de12d1a6181d2a2baf34696ac24 /plugins/jetpack/modules/widgets/simple-payments.php | |
parent | Updating script for Update (diff) | |
download | blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.gz blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.bz2 blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.zip |
Update jetpack 8.0
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/widgets/simple-payments.php')
-rw-r--r-- | plugins/jetpack/modules/widgets/simple-payments.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/widgets/simple-payments.php b/plugins/jetpack/modules/widgets/simple-payments.php index 4eb60bdb..397c43fe 100644 --- a/plugins/jetpack/modules/widgets/simple-payments.php +++ b/plugins/jetpack/modules/widgets/simple-payments.php @@ -1,4 +1,6 @@ <?php +use Automattic\Jetpack\Tracking; + /** * Disable direct access/execution to/of the widget code. */ @@ -13,7 +15,19 @@ if ( ! class_exists( 'Jetpack_Simple_Payments_Widget' ) ) { * Display a Simple Payments Button as a Widget. */ class Jetpack_Simple_Payments_Widget extends WP_Widget { - // https://developer.paypal.com/docs/integration/direct/rest/currency-codes/ + /** + * Currencies should be supported by PayPal: + * @link https://developer.paypal.com/docs/api/reference/currency-codes/ + * + * List has to be in sync with list at the block's client side and API's backend side: + * @link https://github.com/Automattic/jetpack/blob/31efa189ad223c0eb7ad085ac0650a23facf9ef5/extensions/blocks/simple-payments/constants.js#L9-L39 + * @link https://github.com/Automattic/jetpack/blob/31efa189ad223c0eb7ad085ac0650a23facf9ef5/modules/simple-payments/simple-payments.php#L386-L415 + * + * Indian Rupee (INR) is listed here for backwards compatibility with previously added widgets. + * It's not supported by Simple Payments because at the time of the creation of this file + * because it's limited to in-country PayPal India accounts only. + * Discussion: https://github.com/Automattic/wp-calypso/pull/28236 + */ private static $supported_currency_list = array( 'USD' => '$', 'GBP' => '£', @@ -435,7 +449,8 @@ if ( ! class_exists( 'Jetpack_Simple_Payments_Widget' ) ) { return; } - jetpack_tracks_record_event( $current_user, 'jetpack_wpa_simple_payments_button_' . $event_action, $event_properties ); + $tracking = new Tracking(); + $tracking->tracks_record_event( $current_user, 'jetpack_wpa_simple_payments_button_' . $event_action, $event_properties ); $jetpack = Jetpack::init(); // $jetpack->stat automatically prepends the stat group with 'jetpack-' $jetpack->stat( 'simple_payments', $stat_name ); |