Plugin Directory

Changeset 2002317


Ignore:
Timestamp:
12/27/2018 01:52:08 PM (7 years ago)
Author:
mychoice2pay
Message:

Added set completed option and new version 1.2.2

Location:
woo-gateway-mc2p
Files:
5 edited
16 copied

Legend:

Unmodified
Added
Removed
  • woo-gateway-mc2p/tags/1.2.2/languages/wc_gateway_mc2p-es_ES.po

    r1731546 r2002317  
    5959msgstr "Este texto será añadido en la página de gracias"
    6060
     61msgid "Set order as completed after payment?"
     62msgstr "¿Marcar el pedido como completado tras el pago?"
     63
     64msgid ""
     65"After payment, should the order be set as completed? Default is \"processing"
     66"\"."
     67msgstr ""
     68"Tras el pago, ¿deseas marcar el pedido como completado? El valor por defecto "
     69"es \"procesando\"."
     70
     71msgid "No"
     72msgstr "No"
     73
     74msgid "Yes"
     75msgstr "Sí"
     76
    6177msgid "Payment of order "
    6278msgstr "Pago del pedido "
  • woo-gateway-mc2p/tags/1.2.2/wc_gateway_mc2p.php

    r1983253 r2002317  
    66 * Author: MyChoice2Pay
    77 * Author URI: https://www.mychoice2pay.com/
    8  * Version: 1.2.0
     8 * Version: 1.2.2
    99 * Text Domain: wc_mc2p_payment_gateway
    1010 * Domain Path: /i18n/languages/
     
    6262 * @class       WC_Gateway_MC2P
    6363 * @extends     WC_Payment_Gateway
    64  * @version     1.2.0
     64 * @version     1.2.2
    6565 * @package     WooCommerce/Classes/Payment
    6666 * @author      MyChoice2Pay
     
    104104            $this->description  = $this->get_option( 'description' );
    105105            $this->thank_you_text = $this->get_option( 'thank_you_text', $this->description );
     106            $this->set_completed = $this->get_option( 'set_completed', 'N' );
    106107
    107108            // Actions
     
    189190                    'default'     => '',
    190191                    'desc_tip'    => true,
     192                ),
     193                'set_completed' => array(
     194                    'title'       => __( 'Set order as completed after payment?', 'wc-gateway-mc2p' ),
     195                    'type'        => 'select',
     196                    'description' => __( 'After payment, should the order be set as completed? Default is "processing".', 'wc-gateway-mc2p' ),
     197                    'desc_tip'    => false,
     198                    'options'     => array(
     199                        'N' => __( 'No', 'wc-gateway-mc2p' ),
     200                        'Y' => __( 'Yes', 'wc-gateway-mc2p' ),
     201                    ),
     202                    'default'     => 'N'
    191203                ),
    192204            ) );
     
    232244
    233245            if( class_exists( 'WC_Subscriptions_Order' ) && WC_Subscriptions_Order::order_contains_subscription( $order_id ) ) {
    234                 $result = $this->process_subscription_payment( $mc2p, $order, $language);
     246                $result = $this->process_subscription_payment( $mc2p, $order, $language, $order_id );
    235247            } else {
    236                 $result = $this->process_regular_payment( $mc2p, $order, $language);
     248                $result = $this->process_regular_payment( $mc2p, $order, $language, $order_id );
    237249            }
    238250
    239251            // Mark as on-hold (we're awaiting the payment)
    240252            $order->update_status( 'on-hold', __( 'Awaiting MC2P payment', 'wc-gateway-mc2p' ) );
    241 
    242             // Reduce stock levels
    243             $order->reduce_order_stock();
    244253
    245254            if ( version_compare( WOOCOMMERCE_VERSION, '2.0', '<' ) ) {
     
    261270         * @return array
    262271         */
    263         public function process_regular_payment( $mc2p, $order, $language ) {
     272        public function process_regular_payment( $mc2p, $order, $language, $order_id ) {
    264273
    265274            // Create transaction
     
    300309         * @return array
    301310         */
    302         public function process_subscription_payment( $mc2p, $order, $language ) {
     311        public function process_subscription_payment( $mc2p, $order, $language, $order_id ) {
    303312
    304313            $unconverted_periods = array(
  • woo-gateway-mc2p/trunk/languages/wc_gateway_mc2p-es_ES.po

    r1731546 r2002317  
    5959msgstr "Este texto será añadido en la página de gracias"
    6060
     61msgid "Set order as completed after payment?"
     62msgstr "¿Marcar el pedido como completado tras el pago?"
     63
     64msgid ""
     65"After payment, should the order be set as completed? Default is \"processing"
     66"\"."
     67msgstr ""
     68"Tras el pago, ¿deseas marcar el pedido como completado? El valor por defecto "
     69"es \"procesando\"."
     70
     71msgid "No"
     72msgstr "No"
     73
     74msgid "Yes"
     75msgstr "Sí"
     76
    6177msgid "Payment of order "
    6278msgstr "Pago del pedido "
  • woo-gateway-mc2p/trunk/wc_gateway_mc2p.php

    r1983253 r2002317  
    66 * Author: MyChoice2Pay
    77 * Author URI: https://www.mychoice2pay.com/
    8  * Version: 1.2.0
     8 * Version: 1.2.2
    99 * Text Domain: wc_mc2p_payment_gateway
    1010 * Domain Path: /i18n/languages/
     
    6262 * @class       WC_Gateway_MC2P
    6363 * @extends     WC_Payment_Gateway
    64  * @version     1.2.0
     64 * @version     1.2.2
    6565 * @package     WooCommerce/Classes/Payment
    6666 * @author      MyChoice2Pay
     
    104104            $this->description  = $this->get_option( 'description' );
    105105            $this->thank_you_text = $this->get_option( 'thank_you_text', $this->description );
     106            $this->set_completed = $this->get_option( 'set_completed', 'N' );
    106107
    107108            // Actions
     
    189190                    'default'     => '',
    190191                    'desc_tip'    => true,
     192                ),
     193                'set_completed' => array(
     194                    'title'       => __( 'Set order as completed after payment?', 'wc-gateway-mc2p' ),
     195                    'type'        => 'select',
     196                    'description' => __( 'After payment, should the order be set as completed? Default is "processing".', 'wc-gateway-mc2p' ),
     197                    'desc_tip'    => false,
     198                    'options'     => array(
     199                        'N' => __( 'No', 'wc-gateway-mc2p' ),
     200                        'Y' => __( 'Yes', 'wc-gateway-mc2p' ),
     201                    ),
     202                    'default'     => 'N'
    191203                ),
    192204            ) );
     
    232244
    233245            if( class_exists( 'WC_Subscriptions_Order' ) && WC_Subscriptions_Order::order_contains_subscription( $order_id ) ) {
    234                 $result = $this->process_subscription_payment( $mc2p, $order, $language);
     246                $result = $this->process_subscription_payment( $mc2p, $order, $language, $order_id );
    235247            } else {
    236                 $result = $this->process_regular_payment( $mc2p, $order, $language);
     248                $result = $this->process_regular_payment( $mc2p, $order, $language, $order_id );
    237249            }
    238250
    239251            // Mark as on-hold (we're awaiting the payment)
    240252            $order->update_status( 'on-hold', __( 'Awaiting MC2P payment', 'wc-gateway-mc2p' ) );
    241 
    242             // Reduce stock levels
    243             $order->reduce_order_stock();
    244253
    245254            if ( version_compare( WOOCOMMERCE_VERSION, '2.0', '<' ) ) {
     
    261270         * @return array
    262271         */
    263         public function process_regular_payment( $mc2p, $order, $language ) {
     272        public function process_regular_payment( $mc2p, $order, $language, $order_id ) {
    264273
    265274            // Create transaction
     
    300309         * @return array
    301310         */
    302         public function process_subscription_payment( $mc2p, $order, $language ) {
     311        public function process_subscription_payment( $mc2p, $order, $language, $order_id ) {
    303312
    304313            $unconverted_periods = array(
Note: See TracChangeset for help on using the changeset viewer.