cancel
Showing results for 
Search instead for 
Did you mean: 

Who Me Too'd this topic

PHP - Setting invoicenumber and description with Capture a Previously Authorized Amount api call

 Hi,

 

I'm using the Capture Previously Authorized Amount api call and I'm able to capture and set the amount. Though, when I set the description and invoicenumber on the <order> tag, the description and invoicenumber do not get changed when I check the transaction in the sandbox.

 

Is it even possible to set the description and invoice number or just the amount?

Below is the code I'm using to send the request.

 

		$orderRequestType = new AnetAPI\OrderType();	    
		$orderRequestType->setInvoiceNumber($invoiceNumber);
		$orderRequestType->setDescription("Reprocessing transaction");

		$transactionRequestType = new AnetAPI\TransactionRequestType();
		$transactionRequestType->setTransactionType("priorAuthCaptureTransaction");		
		$transactionRequestType->setAmount($dueAmount);		
		$transactionRequestType->setOrder($orderRequestType);		
		$transactionRequestType->setRefTransId($externalTransactionID);		

		$request = new AnetAPI\CreateTransactionRequest();
		$request->setMerchantAuthentication($this->merchantAuthentication);
		$request->setRefId( $this->refId);
		$request->setTransactionRequest($transactionRequestType);
		
		echo $request->getTransactionRequest()->getOrder()->getInvoiceNumber(); //debug, this prints the correct string

		$controller = new AnetController\CreateTransactionController($request);
		$response = $controller->executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);
RogDev2016
Member
Who Me Too'd this topic