Plugin Directory

Changeset 2744562


Ignore:
Timestamp:
06/18/2022 12:42:06 PM (4 years ago)
Author:
idpayir
Message:

update to version 1.2.0

Location:
idpay-mycred/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • idpay-mycred/trunk/class-mycred-gateway-idpay.php

    r2408296 r2744562  
    128128                            <input id="<?php echo $this->field_id( 'sandbox' ); ?>"
    129129                                   name="<?php echo $this->field_name( 'sandbox' ); ?>"
    130                                    <?php echo $prefs['sandbox'] == "on"? 'checked="checked"' : '' ?>
     130                                   <?php echo $prefs['sandbox'] == false ? '' : 'checked="checked"' ?>
    131131                                   type="checkbox"/>
    132132                        </div>
     
    185185                $new_data['currency']           = sanitize_text_field( $data['currency'] );
    186186                $new_data['item_name']          = sanitize_text_field( $data['item_name'] );
    187                 $new_data['sandbox']            = sanitize_text_field( $data['sandbox'] );
     187                $new_data['sandbox']            = sanitize_text_field( $data['sandbox'] ) == 'on' ? 'on' : 'off';
    188188
    189189                if ( isset( $data['exchange'] ) ) {
     
    214214                if ( $status == 10 ) {
    215215                    $api_key = $api_key = $this->prefs['api_key'];
    216                     $sandbox = $this->prefs['sandbox'];
     216                    $sandbox = !($this->prefs['sandbox'] == false);
    217217
    218218                    $data = [
     
    234234                    if ( is_wp_error( $response ) ) {
    235235                        $log = $response->get_error_message();
    236                         $this->log_call( $pending_post_id, $log );
    237236                        $mycred->add_to_log(
    238237                            'buy_creds_with_idpay',
     
    254253                    if ( $http_status != 200 ) {
    255254                        $log = sprintf( __( 'An error occurred while verifying the transaction. status: %s, code: %s, message: %s', 'idpay-mycred' ), $http_status, $result->error_code, $result->error_message );
    256                         $this->log_call( $pending_post_id, $log );
    257255                        $mycred->add_to_log(
    258256                            'buy_creds_with_idpay',
     
    277275
    278276                        if ( $this->complete_payment( $org_pending_payment, $id ) ) {
    279 
    280                             $this->log_call( $pending_post_id, $message );
    281                             $this->trash_pending_payment( $pending_post_id );
    282 
    283                             $return = add_query_arg( 'mycred_idpay_ok', $message, $this->get_thankyou() );
    284                             wp_redirect( $return );
    285                             exit;
    286                         } else {
    287 
    288                             $log = sprintf( __( 'An unexpected error occurred when completing the payment but it is done at the gateway. Track id is: %s', 'idpay-mycred', $result->track_id ) );
    289                             $this->log_call( $pending_post_id, $log );
    290277                            $mycred->add_to_log(
    291278                                'buy_creds_with_idpay',
     
    296283                                $result
    297284                            );
     285                            $this->trash_pending_payment( $pending_post_id );
     286
     287                            $return = add_query_arg( 'mycred_idpay_ok', $message, $this->get_thankyou() );
     288                            wp_redirect( $return );
     289                            exit;
     290                        } else {
     291
     292                            $log = sprintf( __( 'An unexpected error occurred when completing the payment but it is done at the gateway. Track id is: %s', 'idpay-mycred', $result->track_id ) );
     293                            $mycred->add_to_log(
     294                                'buy_creds_with_idpay',
     295                                $pending_payment->buyer_id,
     296                                $pending_payment->amount,
     297                                $log,
     298                                $pending_payment->buyer_id,
     299                                $result
     300                            );
    298301
    299302                            $return = add_query_arg( 'mycred_idpay_nok', $log, $this->get_cancelled() );
     
    304307
    305308                    $log = sprintf( __( 'Payment failed. Status: %s, Track id: %s, Card no: %s', 'idpay-mycred' ), $result->status, $result->track_id, $result->payment->card_no );
    306                     $this->log_call( $pending_post_id, $log );
    307309                    $mycred->add_to_log(
    308310                        'buy_creds_with_idpay',
     
    322324
    323325                    $log = sprintf( __( '%s (Code: %s), Track id: %s', 'idpay-mycred' ), $error, $status, $track_id );
    324                     $this->log_call( $pending_post_id, $log );
    325326                    $mycred->add_to_log(
    326327                        'buy_creds_with_idpay',
     
    386387                $callback = add_query_arg( 'payment_id', $this->transaction_id, $this->callback_url() );
    387388                $api_key  = $this->prefs['api_key'];
    388                 $sandbox  = $this->prefs['sandbox'];
    389 
     389                $sandbox  = $this->prefs['sandbox'] == false ? false : true;
    390390                $data = [
    391391                    'order_id' => $this->transaction_id,
  • idpay-mycred/trunk/idpay-mycred.php

    r2408296 r2744562  
    22/*
    33Plugin Name: IDPay myCRED
    4 Version: 1.1.1
     4Version: 1.2.0
    55Description: IDPay payment gateway for myCRED
    66Author: IDPay
  • idpay-mycred/trunk/readme.txt

    r2408296 r2744562  
    11=== IDPay myCRED ===
    2 Contributors: imikiani, meysamrazmi, vispa
    3 Tags: idpay, gateway, mycred, point, credit
    4 Stable tag: 1.1.1
    5 Tested up to: 5.2
     2Contributors: imikiani, meysamrazmi, vispa, Mohammad Malek(MimDeveloper.Tv)
     3Tags: idpay, gateway, mycred, point, credit,payment
     4Stable tag: 1.2.0
     5Tested up to: 6.0
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1818
    1919== Changelog ==
     20
     21= 1.2.0, June 13, 2022 =
     22* Fix SandBox Mode For Payment In Fake State
     23* Important : Fix Save Transaction Status In Wrong Location
    2024
    2125= 1.1.1, October 13, 2020 =
Note: See TracChangeset for help on using the changeset viewer.