cancel
Showing results for 
Search instead for 
Did you mean: 

RefID not being returned in get transaction detail

I am trying to get the refId from the transaction details related to a webhook response to a Hosted Accept page (the payment page works, get a token, getting the webhook response with no problems) and the refId (our order number) that is sent to the transaction is not getting returned in the refId from the get trans detail.

 

The code I use to set the refId is on getting the payment page:

 

GetHostedPaymentPageRequest apiRequest = new GetHostedPaymentPageRequest();
apiRequest.setTransactionRequest(txnRequest);
apiRequest.setHostedPaymentSettings(alist);
apiRequest.setRefId(refId);

GetHostedPaymentPageController controller = new GetHostedPaymentPageController(apiRequest);
controller.execute();

GetHostedPaymentPageResponse response = new GetHostedPaymentPageResponse();
response = controller.getApiResponse();

 

The getting and using of the page works fine, but when I get the transaction deatils from the transactionId passed back in the webhook, it returns null for the refId.

 

The code I am using to get the transaction data works with no problem and is below:

 

public static GetTransactionDetailsResponse getAnetTransaction(String transactionId)
{
ApiOperationBase.setEnvironment(getEnvMode());
MerchantAuthenticationType merchantAuthenticationType = new MerchantAuthenticationType() ;
merchantAuthenticationType.setName(CAPCP_PMT_VENDOR_ID_1);
merchantAuthenticationType.setTransactionKey(CAPCP_PMT_VENDOR_ID_2);
ApiOperationBase.setMerchantAuthentication(merchantAuthenticationType);

GetTransactionDetailsRequest getRequest = new GetTransactionDetailsRequest();
getRequest.setMerchantAuthentication(merchantAuthenticationType);
getRequest.setTransId(transactionId);

GetTransactionDetailsController controller = new GetTransactionDetailsController(getRequest);
controller.execute();
GetTransactionDetailsResponse getResponse = controller.getApiResponse();

if (getResponse != null)
{
if (getResponse.getMessages().getResultCode() == MessageTypeEnum.OK)
{
System.out.println(new Date().toString() + " - >>>> getAnetTransaction: Got ANET transaction data for OrderNo: " + getResponse.getRefId());
}
else
{
System.out.println(new Date().toString() + " - >>>> getAnetTransaction: Failed to get transaction details: transactionId: " + transactionId
+ " ResultCode: "+ getResponse.getMessages().getResultCode());
}
}
return getResponse;
}

 

Can someone let me know if I am missing something or this is the incorrect way to link a webhook to the order that is processed?

 

I have not been able to find anything else on how to link a payment result to the initiating order that is linked to the webhook trans ID as the trans id does not seem to be returned with the page initialization.

 

Thanks for any help,

Ed

synconnv1
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @synconnv1

 

As a workaround you can pass the refID in the invoiceNumber field under the order when calling the getHostedPaymentPageRequest. 

 

You should be getting back the invoiceNumber in the getTransactionDetails call . 

 

Hope this helps . 





Send feedback at developer_feedback@authorize.net

View solution in original post

16 REPLIES 16

Hi @synconnv1

 

Thanks for your post .  This is a bug in the Accept Hosted where refID is not getting passed correctly . 

 

Our team is currently working on a fix for it . We will update the post once we are near the release . 

 

Also we are going to enhance our Webhook Notifications to return the merchantRefID and

 

invoiceNumber in the payload in an upcoming release . 

 

Thanks





Send feedback at developer_feedback@authorize.net
Anurag
Moderator Moderator
Moderator

Hey Anurag,

Its good to know its a bug and I am not crazy, but the problem is my client wants to go live and with this bug I have not been able to find any other way to link the transaction coming back from the webhook to my system's order.

 

Until this gets fixed, how do I get some sort of reference back to my system so I can know what order the payment needs to be posted back to?

 

Thanks,

Ed

Hi @synconnv1

 

As a workaround you can pass the refID in the invoiceNumber field under the order when calling the getHostedPaymentPageRequest. 

 

You should be getting back the invoiceNumber in the getTransactionDetails call . 

 

Hope this helps . 





Send feedback at developer_feedback@authorize.net

Has this been fixed ?

Has this been fixed ?

I can confirm that this issue has not yet been fixed, but I am told that it has been escalated and is expected in an upcoming release.

coppercup
Regular Contributor

Also confirming that this still doesn't work.  

 

Even if you set the refId on the original transaction, getTransactionDetails does NOT return the value in transRefId.  

 

And to clarify, this is the transRefId field we're talking about.  Not the refTransId field (which would contain the original transaction Id for say a refund) and not the refId field (which would contain the refId value submitted with the getTransactionDetails request.

 

 

-------------------------------------------------
Ron
Linvio, Inc.
Salesforce.com/Authnet Integration

Glad I found this thread. Was struggling with this today, and frustrated that transRefId was coming back null. Hoping for a fix soon.

Not fixed yet?