Reply
Contributor
Posts: 15
Registered: ‎12-08-2014

NULL pointer exception ( importRefId )

Hello,

 

Code snippet 

 

		Merchant merchant = createMerchant("**LOGINID**", "**transactionKey**");
		net.authorize.cim.Transaction txn = merchant.createCIMTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);
		txn.setRefId("**REFID**");
		txn.setCustomerPaymentProfileId(*******);
		txn.setCustomerProfileId(********);

		PaymentTransaction paymentTransaction = PaymentTransaction.createPaymentTransaction();
		//creating order -txn amount details
		net.authorize.data.Order order = net.authorize.data.Order.createOrder();
		order.setInvoiceNumber(******);
		order.setTotalAmount(****);
		order.setDescription(******);
		paymentTransaction.setOrder(order);
		paymentTransaction.setTransactionType(net.authorize.TransactionType.AUTH_CAPTURE);
		txn.setPaymentTransaction(paymentTransaction);

		Result<net.authorize.cim.Transaction> result = (Result<net.authorize.cim.Transaction>) merchant.postTransaction(txn)

Error 

 

java.lang.NullPointerException
	at net.authorize.cim.Result.importRefId(Result.java:109)
	at net.authorize.cim.Result.createResult(Result.java:47)
	at net.authorize.Merchant.postTransaction(Merchant.java:296)

 

 

 

 

 

 

Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: NULL pointer exception ( importRefId )

[ Edited ]