| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Tamara Checkout |
| 4 |
* Plugin URI: https://tamara.co/ |
| 5 |
* Description: With Tamara Buy Now Pay Later, you can split your payments – totally interest-free. Accepts payments from Mada, Apple Pay, or Credit Cards. |
| 6 |
* Author: dev@tamara.co |
| 7 |
* Author URI: https://tamara.co/ |
| 8 |
* Version: 1.9.9.23 |
| 9 |
* License: GPLv2 or later |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 |
* Text Domain: tamara-checkout |
| 12 |
*/ |
| 13 |
|
| 14 |
use Tamara\Wp\Plugin\TamaraCheckout; |
| 15 |
|
| 16 |
defined('TAMARA_CHECKOUT_VERSION') || define('TAMARA_CHECKOUT_VERSION', '1.9.9.23'); |
| 17 |
|
| 18 |
// Use autoload if it isn't loaded before |
| 19 |
// phpcs:ignore PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace |
| 20 |
if ( ! class_exists(TamaraCheckout::class)) { |
| 21 |
require __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; |
| 22 |
} |
| 23 |
|
| 24 |
$config = require(__DIR__ . DIRECTORY_SEPARATOR . 'config.php'); |
| 25 |
$config = array_merge($config, [ |
| 26 |
'pluginFilename' => __FILE__, |
| 27 |
]); |
| 28 |
|
| 29 |
// We need to set up the main instance for the plugin. |
| 30 |
// Use 'woocommerce_init' to execute after WC init. |
| 31 |
add_action('woocommerce_init', function () use ($config) { |
| 32 |
TamaraCheckout::initInstanceWithConfig($config); |
| 33 |
|
| 34 |
register_activation_hook(__FILE__, [TamaraCheckout::getInstance(), 'activatePlugin']); |
| 35 |
register_deactivation_hook(__FILE__, [TamaraCheckout::getInstance(), 'deactivatePlugin']); |
| 36 |
|
| 37 |
TamaraCheckout::getInstance()->initPlugin(); |
| 38 |
}); |
| 39 |
|