public function registerTransaction($amount, $localTrxID) {
		$token = $this->authenticate();
		
		// paypal like the amount as string, to prevent floating point errors
		if (!is_string($amount))
			$amount = sprintf("%0.2f", $amount);
		
		$a = (object)[
			"amount" => (object)[
				"total" => $amount,
				"currency" => $this->currency,
			]
		];	
		
		$route = Route::get('paypal_response');
		$base = URL::base(true);
		$payment_data = (object)[
			'intent' => "sale",
			'redirect_urls' => (object)[
				'return_url' => $base . $route->uri([
						'action' => 'complete', 'trxid' => $localTrxID]),
				'cancel_url' => $base . $route->uri([
						'action' => 'cancel', 'trxid' => $localTrxID]),
			],
			'payer' => (object)[ 'payment_method' => 'paypal', ],
    		"transactions" => [ $a ],
        ];
		
		$request = $this->genRequest('payments/payment', $payment_data, $token);
		return $this->call($request);
	}
public function registerTransaction($amount, $localTrxID) {
		$token = $this->authenticate();
		
		// paypal like the amount as string, to prevent floating point errors
		if (!is_string($amount))
			$amount = sprintf("%0.2f", $amount);
		
		$a = (object)[
			"amount" => (object)[
				"total" => $amount,
				"currency" => $this->currency,
			]
		];	
		
		$route = Route::get('paypal_response');
		$base = URL::base(true);
		$payment_data = (object)[
			'intent' => "sale",
			'redirect_urls' => (object)[
				'return_url' => $base . $route->uri([
						'action' => 'complete', 'trxid' => $localTrxID]),
				'cancel_url' => $base . $route->uri([
						'action' => 'cancel', 'trxid' => $localTrxID]),
			],
			'payer' => (object)[ 'payment_method' => 'paypal', ],
    		"transactions" => [ $a ],
        ];
		
		$request = $this->genRequest('payments/payment', $payment_data, $token);
		return $this->call($request);
	}
public function registerTransaction ( $ amount , $ localTrxID ) { $ token = $ this -> authenticate ( ) ; // paypal like the amount as string, to prevent floating point errors if ( ! is_string ( $ amount ) ) $ amount = sprintf ( "%0.2f" , $ amount ) ; $ a = ( object ) [ "amount" => ( object ) [ "total" => $ amount , "currency" => $ this -> currency , ] ] ; $ route = Route :: get ( 'paypal_response' ) ; $ base = URL :: base ( true ) ; $ payment_data = ( object ) [ 'intent' => "sale" , 'redirect_urls' => ( object ) [ 'return_url' => $ base . $ route -> uri ( [ 'action' => 'complete' , 'trxid' => $ localTrxID ] ) , 'cancel_url' => $ base . $ route -> uri ( [ 'action' => 'cancel' , 'trxid' => $ localTrxID ] ) , ] , 'payer' => ( object ) [ 'payment_method' => 'paypal' , ] , "transactions" => [ $ a ] , ] ; $ request = $ this -> genRequest ( 'payments/payment' , $ payment_data , $ token ) ; return $ this -> call ( $ request ) ; }
Register the transaction with PayPal

@param string $amount a single transaction price
@param unknown $localTrxID application transaciton object
@return mixed
Register the transaction with PayPal