original_string: public function void() {
  		$json = array();
  
  		$this->load->language('extension/payment/pp_express_order');
  
  		if (isset($this->request->get['order_id'])) {
  			$order_id = $this->request->get['order_id'];
  		} else {
  			$order_id = 0;
  		}
  
  		$this->load->model('extension/payment/pp_express');
  
  		$paypal_info = $this->model_extension_payment_pp_express->getOrder($order_id);
  
  		if ($paypal_info) {
  			$request = array(
  				'METHOD'          => 'DoVoid',
  				'AUTHORIZATIONID' => $paypal_info['authorization_id'],
  				'MSGSUBID'        => uniqid(mt_rand(), true)
  			);
  
  			$response = $this->model_extension_payment_pp_express->call($request);
  
  			if (isset($response['ACK']) && ($response['ACK'] != 'Failure') && ($response['ACK'] != 'FailureWithWarning')) {
  				$transaction = array(
  					'paypal_order_id'       => $paypal_info['paypal_order_id'],
  					'transaction_id'        => '',
  					'parent_id'             => $paypal_info['authorization_id'],
  					'note'                  => '',
  					'msgsubid'              => '',
  					'receipt_id'            => '',
  					'payment_type'          => 'void',
  					'payment_status'        => 'Void',
  					'pending_reason'        => '',
  					'transaction_entity'    => 'auth',
  					'amount'                => '',
  					'debug_data'            => json_encode($response)
  				);
  
  				$this->model_extension_payment_pp_express->addTransaction($transaction);
  
  				$this->model_extension_payment_pp_express->editPayPalOrderStatus($order_id, 'Complete');
  
  				$json['capture_status'] = 'Complete';
  
  				$json['success'] = $this->language->get('text_success');
  			} else {
  				$json['error'] = (isset($response['L_SHORTMESSAGE0']) ? $response['L_SHORTMESSAGE0'] : $this->language->get('error_transaction'));
  			}
  		} else {
  			$json['error'] = $this->language->get('error_not_found');
  		}
  
  		$this->response->addHeader('Content-Type: application/json');
  		$this->response->setOutput(json_encode($json));
  	}
code: public function void() {
  		$json = array();
  
  		$this->load->language('extension/payment/pp_express_order');
  
  		if (isset($this->request->get['order_id'])) {
  			$order_id = $this->request->get['order_id'];
  		} else {
  			$order_id = 0;
  		}
  
  		$this->load->model('extension/payment/pp_express');
  
  		$paypal_info = $this->model_extension_payment_pp_express->getOrder($order_id);
  
  		if ($paypal_info) {
  			$request = array(
  				'METHOD'          => 'DoVoid',
  				'AUTHORIZATIONID' => $paypal_info['authorization_id'],
  				'MSGSUBID'        => uniqid(mt_rand(), true)
  			);
  
  			$response = $this->model_extension_payment_pp_express->call($request);
  
  			if (isset($response['ACK']) && ($response['ACK'] != 'Failure') && ($response['ACK'] != 'FailureWithWarning')) {
  				$transaction = array(
  					'paypal_order_id'       => $paypal_info['paypal_order_id'],
  					'transaction_id'        => '',
  					'parent_id'             => $paypal_info['authorization_id'],
  					'note'                  => '',
  					'msgsubid'              => '',
  					'receipt_id'            => '',
  					'payment_type'          => 'void',
  					'payment_status'        => 'Void',
  					'pending_reason'        => '',
  					'transaction_entity'    => 'auth',
  					'amount'                => '',
  					'debug_data'            => json_encode($response)
  				);
  
  				$this->model_extension_payment_pp_express->addTransaction($transaction);
  
  				$this->model_extension_payment_pp_express->editPayPalOrderStatus($order_id, 'Complete');
  
  				$json['capture_status'] = 'Complete';
  
  				$json['success'] = $this->language->get('text_success');
  			} else {
  				$json['error'] = (isset($response['L_SHORTMESSAGE0']) ? $response['L_SHORTMESSAGE0'] : $this->language->get('error_transaction'));
  			}
  		} else {
  			$json['error'] = $this->language->get('error_not_found');
  		}
  
  		$this->response->addHeader('Content-Type: application/json');
  		$this->response->setOutput(json_encode($json));
  	}
code_tokens: public function void ( ) { $ json = array ( ) ; $ this -> load -> language ( 'extension/payment/pp_express_order' ) ; if ( isset ( $ this -> request -> get [ 'order_id' ] ) ) { $ order_id = $ this -> request -> get [ 'order_id' ] ; } else { $ order_id = 0 ; } $ this -> load -> model ( 'extension/payment/pp_express' ) ; $ paypal_info = $ this -> model_extension_payment_pp_express -> getOrder ( $ order_id ) ; if ( $ paypal_info ) { $ request = array ( 'METHOD' => 'DoVoid' , 'AUTHORIZATIONID' => $ paypal_info [ 'authorization_id' ] , 'MSGSUBID' => uniqid ( mt_rand ( ) , true ) ) ; $ response = $ this -> model_extension_payment_pp_express -> call ( $ request ) ; if ( isset ( $ response [ 'ACK' ] ) && ( $ response [ 'ACK' ] != 'Failure' ) && ( $ response [ 'ACK' ] != 'FailureWithWarning' ) ) { $ transaction = array ( 'paypal_order_id' => $ paypal_info [ 'paypal_order_id' ] , 'transaction_id' => '' , 'parent_id' => $ paypal_info [ 'authorization_id' ] , 'note' => '' , 'msgsubid' => '' , 'receipt_id' => '' , 'payment_type' => 'void' , 'payment_status' => 'Void' , 'pending_reason' => '' , 'transaction_entity' => 'auth' , 'amount' => '' , 'debug_data' => json_encode ( $ response ) ) ; $ this -> model_extension_payment_pp_express -> addTransaction ( $ transaction ) ; $ this -> model_extension_payment_pp_express -> editPayPalOrderStatus ( $ order_id , 'Complete' ) ; $ json [ 'capture_status' ] = 'Complete' ; $ json [ 'success' ] = $ this -> language -> get ( 'text_success' ) ; } else { $ json [ 'error' ] = ( isset ( $ response [ 'L_SHORTMESSAGE0' ] ) ? $ response [ 'L_SHORTMESSAGE0' ] : $ this -> language -> get ( 'error_transaction' ) ) ; } } else { $ json [ 'error' ] = $ this -> language -> get ( 'error_not_found' ) ; } $ this -> response -> addHeader ( 'Content-Type: application/json' ) ; $ this -> response -> setOutput ( json_encode ( $ json ) ) ; }
docstring: used to void an authorised payment
docstring_tokens: used to void an authorised payment