.
- * @since 2.0.0
- * @version 2.0.0
- */
-
-namespace wpshop;
-
-defined( 'ABSPATH' ) || exit;
-
-/**
- * Documentation des variables utilisées dans la vue.
- *
- * @var array $paypal_options Le tableau contenant toutes les données de la méthode de paiement Paypal.
- */
-?>
-
-
-
-
-
-
-
diff --git a/modules/paypal/view/index.php b/modules/paypal/view/index.php
deleted file mode 100644
index 6220032..0000000
--- a/modules/paypal/view/index.php
+++ /dev/null
@@ -1,2 +0,0 @@
-
- * @copyright (c) 2011-2020 Eoxia .
- * @since 2.0.0
- * @version 2.0.0
- */
-
-namespace wpshop;
-
-use eoxia\View_Util;
-
-defined( 'ABSPATH' ) || exit;
-
-/**
- * Stripe Action Class.
- */
-class Stripe_Action {
- /**
- * Le constructeur.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- public function __construct() {
- add_action( 'wp_head', array( $this, 'define_stripe_option' ) );
-
- add_action( 'wp_enqueue_scripts', array( $this, 'callback_enqueue_scripts' ), 9 );
-
- add_action( 'wps_setting_payment_method_stripe_after_form', array( $this, 'callback_setting_payment_method' ), 10, 0 );
- add_action( 'wps_update_payment_method_data', array( $this, 'update_method_payment_stripe' ), 10, 2 );
-
- add_action( 'wps_gateway_stripe', array( $this, 'callback_wps_gateway_stripe' ), 10, 1 );
- }
-
- /**
- * Ajoute la variable stripe_key pour la rendre acessible dans le JS.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- public function define_stripe_option() {
- $stripe_options = Payment::g()->get_payment_option( 'stripe' );
-
- echo '';
- }
-
- /**
- * Inclus le JS de stripe.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- public function callback_enqueue_scripts() {
- if ( Pages::g()->is_checkout_page() ) {
- wp_enqueue_script( 'wpshop-stripe', 'https://js.stripe.com/v3/', array(), \eoxia\Config_Util::$init['wpshop']->version );
- }
- }
-
- /**
- * Ajoute la page pour configurer le paiement Stripe.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- public function callback_setting_payment_method() {
- $stripe_options = Payment::g()->get_payment_option( 'stripe' );
- View_Util::exec( 'wpshop', 'stripe', 'form-setting', array(
- 'stripe_options' => $stripe_options,
- ) );
- }
-
- /**
- * Met à jour les réglages de Stripe.
- *
- * @since 2.0.0
- * @version 2.0.0
- *
- * @param array $data Les données de Stripe.
- * @param array $type Le type de méthode de paiement.
- *
- * @return array Les données de Stripe
- */
- public function update_method_payment_stripe( $data, $type ) {
- if ( 'stripe' === $type ) {
- $publish_key = ! empty( $_POST['publish_key'] ) ? sanitize_text_field( $_POST['publish_key'] ) : '';
- $secret_key = ! empty( $_POST['secret_key'] ) ? sanitize_text_field( $_POST['secret_key'] ) : '';
- $use_stripe_sandbox = ( isset( $_POST['use_stripe_sandbox'] ) && 'on' === $_POST['use_stripe_sandbox'] ) ? true : false;
-
- $data['stripe']['publish_key'] = $publish_key;
- $data['stripe']['secret_key'] = $secret_key;
- $data['stripe']['use_stripe_sandbox'] = $use_stripe_sandbox;
- }
-
- return $data;
- }
-
- /**
- * Déclenche l'action pour compléter le paiement.
- *
- * @since 2.0.0
- * @version 2.0.0
- *
- * @param array $param Les données reçues par Stripe.
- */
- public function callback_wps_gateway_stripe( $param ) {
- if ( 'order.payment_failed' === $param['type'] ) {
- do_action( 'wps_payment_failed', $param );
- } else {
- do_action( 'wps_payment_complete', $param );
- }
- }
-}
-
-new Stripe_Action();
diff --git a/modules/stripe/action/index.php b/modules/stripe/action/index.php
deleted file mode 100644
index 6220032..0000000
--- a/modules/stripe/action/index.php
+++ /dev/null
@@ -1,2 +0,0 @@
-
- * @copyright (c) 2011-2020 Eoxia .
- * @since 2.0.0
- * @version 2.0.0
- */
-
-namespace wpshop;
-
-use eoxia\Singleton_Util;
-
-defined( 'ABSPATH' ) || exit;
-
-/**
- * Stripe Class.
- */
-class Stripe extends Singleton_Util {
- /**
- * Le constructeur.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- protected function construct() {}
-
- /**
- * Prépare le paiement stripe.
- *
- * @since 2.0.0
- * @version 2.0.0
- *
- * @param Doli_Order $order Les données de la commande.
- *
- * @return array L'ID de la session Stripe.
- */
- public function process_payment( $order ) {
- $stripe_options = Payment::g()->get_payment_option( 'stripe' );
-
- \Stripe\Stripe::setApiKey( $stripe_options['secret_key'] );
- \Stripe\Stripe::setApiVersion( '2019-03-14; checkout_sessions_beta=v1' );
-
- $lines = array(
- 'amount' => (int) ( $order->data['total_ttc'] * 100 ),
- 'quantity' => 1,
- 'name' => $order->data['title'],
- 'currency' => 'eur',
- );
-
- $session = \Stripe\Checkout\Session::create( array(
- 'success_url' => Pages::g()->get_checkout_link() . '/received/order/' . $order->data['external_id'],
- 'cancel_url' => site_url(),
- 'payment_method_types' => array( 'card' ),
- 'line_items' => array( $lines ),
- 'metadata' => array( 'order_id' => $order->data['external_id'] ),
- ) );
-
- return array(
- 'id' => $session->id,
- );
- }
-}
-
-Stripe::g();
diff --git a/modules/stripe/class/index.php b/modules/stripe/class/index.php
deleted file mode 100644
index 6220032..0000000
--- a/modules/stripe/class/index.php
+++ /dev/null
@@ -1,2 +0,0 @@
-
- * @copyright (c) 2011-2020 Eoxia .
- * @since 2.0.0
- * @version 2.0.0
- */
-
-namespace wpshop;
-
-defined( 'ABSPATH' ) || exit;
-
-/**
- * Stripe Filter Class.
- */
-class Stripe_Filter {
-
- /**
- * Le constructeur.
- *
- * @since 2.0.0
- * @version 2.0.0
- */
- public function __construct() {
- add_filter( 'wps_payment_method_stripe_description', array( $this, 'more_stripe_description' ) );
- }
-
- /**
- * Ajoute le text pour indiquer que Stripe est en mode sandbox.
- *
- * @since 2.0.0
- * @version 2.0.0
- *
- * @param string $description Description actuelle.
- *
- * @return string Description modifiée.
- */
- public function more_stripe_description( $description ) {
- $stripe_options = Payment::g()->get_payment_option( 'stripe' );
-
- if ( $stripe_options['use_stripe_sandbox'] ) {
- $description .= __( ' SANDBOX ENABLED', 'wpshop' );
- }
-
- return $description;
- }
-}
-
-new Stripe_Filter();
diff --git a/modules/stripe/filter/index.php b/modules/stripe/filter/index.php
deleted file mode 100644
index 6220032..0000000
--- a/modules/stripe/filter/index.php
+++ /dev/null
@@ -1,2 +0,0 @@
-
- * @copyright (c) 2011-2020 Eoxia .
- * @since 2.0.0
- * @version 2.0.0
- */
-
-namespace wpshop;
-
-defined( 'ABSPATH' ) || exit;
-
-/**
- * Documentation des variables utilisées dans la vue.
- *
- * @var array $stripe_options Le tableau contenant toutes les données de la méthode de paiement Stripe.
- */
-?>
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/modules/stripe/view/index.php b/modules/stripe/view/index.php
deleted file mode 100644
index 6220032..0000000
--- a/modules/stripe/view/index.php
+++ /dev/null
@@ -1,2 +0,0 @@
-
* Author URI: http://www.eoxia.com/
* License: GPLv3