-
Notifications
You must be signed in to change notification settings - Fork 0
/
woocommerce-gateway-paypal-express-checkout.php
65 lines (56 loc) · 1.96 KB
/
woocommerce-gateway-paypal-express-checkout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* Plugin Name: WooCommerce PayPal Checkout Gateway
* Plugin URI: https://woocommerce.com/products/woocommerce-gateway-paypal-express-checkout/
* Description: Accept all major credit and debit cards, plus Venmo and PayPal Credit in the US, presenting options in a customizable stack of payment buttons. Fast, seamless, and flexible.
* Version: 2.1.2
* Author: WooCommerce
* Author URI: https://woocommerce.com
* Copyright: © 2021 WooCommerce / PayPal.
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: woocommerce-gateway-paypal-express-checkout
* Domain Path: /languages
* WC tested up to: 5.4
* WC requires at least: 3.2.0
*/
/**
* Copyright (c) 2019 PayPal, Inc.
*
* The name of the PayPal may not be used to endorse or promote products derived from this
* software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND
* WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
define( 'WC_GATEWAY_PPEC_VERSION', '2.1.2' );
/**
* Return instance of WC_Gateway_PPEC_Plugin.
*
* @return WC_Gateway_PPEC_Plugin
*/
function wc_gateway_ppec() {
static $plugin;
if ( ! isset( $plugin ) ) {
require_once 'includes/class-wc-gateway-ppec-plugin.php';
$plugin = new WC_Gateway_PPEC_Plugin( __FILE__, WC_GATEWAY_PPEC_VERSION );
}
return $plugin;
}
wc_gateway_ppec()->maybe_run();
/**
* Adds the WooCommerce Inbox option on plugin activation
*
* @since 2.1.2
*/
if ( ! function_exists( 'add_woocommerce_inbox_variant' ) ) {
function add_woocommerce_inbox_variant() {
$option = 'woocommerce_inbox_variant_assignment';
if ( false === get_option( $option, false ) ) {
update_option( $option, wp_rand( 1, 12 ) );
}
}
}
register_activation_hook( __FILE__, 'add_woocommerce_inbox_variant' );