WordPress.org

Plugin Directory

Changeset 609902


Ignore:
Timestamp:
10/09/12 07:26:31 (19 months ago)
Author:
kovshenin
Message:

Starting some bugfixes with version 1.2.1

  • Bringing back compatibility with PHP 5.2
  • Removing an undefined index notice
  • More verbose log around SetExpressCheckoutPayment
Location:
camptix/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • camptix/trunk/addons/payment-paypal.php

    r608431 r609902  
    217217     */ 
    218218    function get_status_from_string( $payment_status ) { 
    219         global $camptix; 
    220  
    221219        $statuses = array( 
    222             'Completed' => $camptix::PAYMENT_STATUS_COMPLETED, 
    223             'Pending' => $camptix::PAYMENT_STATUS_PENDING, 
    224             'Cancelled' => $camptix::PAYMENT_STATUS_CANCELLED, 
    225             'Failed' => $camptix::PAYMENT_STATUS_FAILED, 
    226             'Denied' => $camptix::PAYMENT_STATUS_FAILED, 
    227             'Refunded' => $camptix::PAYMENT_STATUS_REFUNDED, 
    228             'Reversed' => $camptix::PAYMENT_STATUS_REFUNDED, 
     220            'Completed' => CampTix_Plugin::PAYMENT_STATUS_COMPLETED, 
     221            'Pending' => CampTix_Plugin::PAYMENT_STATUS_PENDING, 
     222            'Cancelled' => CampTix_Plugin::PAYMENT_STATUS_CANCELLED, 
     223            'Failed' => CampTix_Plugin::PAYMENT_STATUS_FAILED, 
     224            'Denied' => CampTix_Plugin::PAYMENT_STATUS_FAILED, 
     225            'Refunded' => CampTix_Plugin::PAYMENT_STATUS_REFUNDED, 
     226            'Reversed' => CampTix_Plugin::PAYMENT_STATUS_REFUNDED, 
    229227        ); 
    230228 
     
    255253         */ 
    256254 
    257         return $this->payment_result( $payment_token, $camptix::PAYMENT_STATUS_CANCELLED ); 
     255        return $this->payment_result( $payment_token, CampTix_Plugin::PAYMENT_STATUS_CANCELLED ); 
    258256    } 
    259257 
     
    350348                ); 
    351349                $this->log( 'Error during DoExpressCheckoutPayment.', null, $request ); 
    352                 return $this->payment_result( $payment_token, $camptix::PAYMENT_STATUS_FAILED, $payment_data ); 
     350                return $this->payment_result( $payment_token, CampTix_Plugin::PAYMENT_STATUS_FAILED, $payment_data ); 
    353351            } 
    354352        } else { 
     
    358356            ); 
    359357            $this->log( 'Error during GetExpressCheckoutDetails.', null, $request ); 
    360             return $this->payment_result( $payment_token, $camptix::PAYMENT_STATUS_FAILED, $payment_data ); 
     358            return $this->payment_result( $payment_token, CampTix_Plugin::PAYMENT_STATUS_FAILED, $payment_data ); 
    361359        } 
    362360 
     
    417415            $this->log( 'Error during SetExpressCheckout.', null, $response ); 
    418416            $error_code = isset( $response['L_ERRORCODE0'] ) ? $response['L_ERRORCODE0'] : 0; 
    419             return $this->payment_result( $payment_token, $camptix::PAYMENT_STATUS_FAILED, array( 
     417            return $this->payment_result( $payment_token, CampTix_Plugin::PAYMENT_STATUS_FAILED, array( 
    420418                'error_code' => $error_code, 
     419                'raw' => $request, 
    421420            ) ); 
    422421        } 
  • camptix/trunk/camptix.php

    r608434 r609902  
    44 * Plugin URI: http://wordcamp.org 
    55 * Description: Simple and flexible event ticketing for WordPress. 
    6  * Version: 1.2 
     6 * Version: 1.2.1 
    77 * Author: Automattic 
    88 * Author URI: http://wordcamp.org 
     
    51205120        if ( isset( $_POST['tix_payment_method'] ) && array_key_exists( $_POST['tix_payment_method'], $this->get_enabled_payment_methods() ) ) 
    51215121            $payment_method = $_POST['tix_payment_method']; 
    5122         elseif ( $this->order['price'] > 0 ) { 
     5122        elseif ( ! empty( $this->order['price'] ) && $this->order['price'] > 0 ) { 
    51235123            $this->error_flags['invalid_payment_method'] = true; 
    51245124        } 
     
    52755275 
    52765276        } else { // free beer for everyone! 
    5277             $this->payment_result( $payment_token, $this::PAYMENT_STATUS_COMPLETED ); 
     5277            $this->payment_result( $payment_token, self::PAYMENT_STATUS_COMPLETED ); 
    52785278        } 
    52795279    } 
     
    55065506            update_post_meta( $attendee->ID, 'tix_transaction_details', $transaction_details ); 
    55075507 
    5508             if ( $this::PAYMENT_STATUS_CANCELLED == $result ) { 
     5508            if ( self::PAYMENT_STATUS_CANCELLED == $result ) { 
    55095509                $attendee->post_status = 'cancel'; 
    55105510                wp_update_post( $attendee ); 
    55115511            } 
    55125512 
    5513             if ( $this::PAYMENT_STATUS_FAILED == $result ) { 
     5513            if ( self::PAYMENT_STATUS_FAILED == $result ) { 
    55145514                $attendee->post_status = 'failed'; 
    55155515                wp_update_post( $attendee ); 
    55165516            } 
    55175517 
    5518             if ( $this::PAYMENT_STATUS_COMPLETED == $result ) { 
     5518            if ( self::PAYMENT_STATUS_COMPLETED == $result ) { 
    55195519                $attendee->post_status = 'publish'; 
    55205520                wp_update_post( $attendee ); 
    55215521            } 
    55225522 
    5523             if ( $this::PAYMENT_STATUS_PENDING == $result ) { 
     5523            if ( self::PAYMENT_STATUS_PENDING == $result ) { 
    55245524                $attendee->post_status = 'pending'; 
    55255525                wp_update_post( $attendee ); 
    55265526            } 
    55275527 
    5528             if ( $this::PAYMENT_STATUS_REFUNDED == $result ) { 
     5528            if ( self::PAYMENT_STATUS_REFUNDED == $result ) { 
    55295529                $attendee->post_status = 'refund'; 
    55305530                wp_update_post( $attendee ); 
     
    55635563        switch ( $result ) : 
    55645564 
    5565             case $this::PAYMENT_STATUS_CANCELLED : 
     5565            case self::PAYMENT_STATUS_CANCELLED : 
    55665566                $this->error_flag( 'payment_cancelled' ); 
    55675567                $this->redirect_with_error_flags(); 
     
    55695569                break; 
    55705570 
    5571             case $this::PAYMENT_STATUS_COMPLETED : 
     5571            case self::PAYMENT_STATUS_COMPLETED : 
    55725572 
    55735573                // Show the purchased tickets. 
     
    55785578                break; 
    55795579 
    5580             case $this::PAYMENT_STATUS_FAILED : 
     5580            case self::PAYMENT_STATUS_FAILED : 
    55815581                $error_code = 0; 
    55825582                if ( ! empty( $data['error_code'] ) ) 
     
    55965596                break; 
    55975597 
    5598             case $this::PAYMENT_STATUS_PENDING : 
     5598            case self::PAYMENT_STATUS_PENDING : 
    55995599 
    56005600                // Show the purchased tickets. 
     
    56055605                break; 
    56065606 
    5607             case $this::PAYMENT_STATUS_REFUNDED : 
     5607            case self::PAYMENT_STATUS_REFUNDED : 
    56085608                // @todo what do we do when a purchase is refunded? 
    56095609                die(); 
Note: See TracChangeset for help on using the changeset viewer.