cancel
Showing results for 
Search instead for 
Did you mean: 

Refund transcation for CIM

Hi

 

I am trying the following code to refund a transaction. The CustomerProfileID, PaymentProfileID and TransactionID all have values for the transaction I have just authorized.

 

I get the error E00014 : customerProfileId and customerPaymentProfileId OR creditCardNumberMasked OR bankRoutingNumberMasked and bankAccountNumberMasked are required.

 

     CIMSOAPAPIUtilities.MerchantAuthentication.name = UserName;

            CIMSOAPAPIUtilities.MerchantAuthentication.transactionKey = Key;

            ProfileTransRefundType refund = new ProfileTransRefundType();

            refund.customerProfileId = profile_id;

            refund.customerPaymentProfileId = payment_profile_id;

          //refund.creditCardNumberMasked = "XXXX"+last4DigitCC;

            refund.amount = RefundAmount;

            refund.transId = transactionId;

            ProfileTransactionType trans = new ProfileTransactionType();

            trans.Item = refund;

 

            CreateCustomerProfileTransactionResponseType response = CIMSOAPAPIUtilities.Service.CreateCustomerProfileTransaction(CIMSOAPAPIUtilities.MerchantAuthentication, trans, null);

            return new CIMAuthorizationDotNetServices(response.directResponse.ToString());

 

 

If I go ahead and add in the XXXX1111 card number then I get this

 

3,2,54,The referenced transaction does not meet the criteria for issuing a credit.,,P,0,,,1.00,CC,credit,12129,egb test test,test,,2300 gree dr,Vally city,oh,44123,,,,,,,,,,,,,,,,,,E6D5A707CFEC84A00919AE1F9E4049ED,,,,,,,,,,,,,XXXX1111,Visa,,,,,,,,,,,,,,,,

 

My guess is ,I am getting this error because I am trying to refund a transaction that is not finalized yet. However I am connected to developer environment. Is this true in the developer environment too.

Any help is grately appriciated.

ggollapinni
Member
16 REPLIES 16

That worked perfectly, thanks TJPride.

I had the exact same scenario.  Setting the following worked:

 

AuthorizeNetWebService.ProfileTransRefundType refund = new AuthorizeNetWebService.ProfileTransRefundType();

 

refund.customerProfileId = cimProfileId;
refund.customerPaymentProfileId = cimPaymentProfileId;
refund.transId = transactionId;
refund.amount = amount;

 

refund.customerProfileIdSpecified = true;
refund.customerPaymentProfileIdSpecified = true;

i'm sorry; i do not think that is true.  in the CIM XML guide, there are no elements called:

 

- customerProfileIdSpecified

- customerPaymentProfileIdSpecified

 

you may be using another authorize.net API but not CIM as far as i can tell.  i did try it and got the:

 

- The element 'profileTransRefund' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'customerProfileIdSpecified'

 

it seems like the only way to issue a refund transaction greater than 120 days is to fill out the ECC form.  at least as far as i can tell.  i have done plenty of refund transactions less than 120 days w/o issue.

Hi,

 

I am facing same issue in the authorize.net(CIM).

 

We have passed required parameters for refund transactions.

 

We have set the requested variables in the authorize.net transactions.

 

   $transaction = new AuthorizeNetTransaction;
   $transaction->customerProfileId = $customer_profile_id;
   $transaction->customerPaymentProfileId =$auth_customer_payment_profile_id;
   $transaction->order->invoiceNumber =$invoice_id;
   $transaction->order->description=$desc;

 

   $response=$sendreq->createCustomerProfileTransaction("Refund",$transaction,'x_duplicate_window=0');

 

//////////////////// REQUESTED TRANSACTIONS ARRAY /////////////////////////////////////////////////

 

 

AuthorizeNetTransaction Object
(
    [amount] => 140.00
    [tax] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [shipping] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [duty] => stdClass Object
        (
            [amount] => 
            [name] => 
            [description] => 
        )

    [lineItems] => Array
        (
        )

    [customerProfileId] => 78987884
    [customerPaymentProfileId] => 15987459
    [customerShippingAddressId] => 
    [creditCardNumberMasked] => 
    [bankRoutingNumberMasked] => 
    [bankAccountNumberMasked] => 
    [order] => stdClass Object
        (
            [invoiceNumber] => 11077
            [description] => Register from - website
            [purchaseOrderNumber] => 
        )

    [taxExempt] => 
    [recurringBilling] => 
    [cardCode] => 
    [splitTenderId] => 
    [approvalCode] => 
    [transId] => 2239407521
)

 

///////////////////////////////////// TRANSACTION RESPONSE ///////////////////////////////////////////////

AuthorizeNetCIM_Response Object
(
    [xml] => SimpleXMLElement Object
        (
            [messages] => SimpleXMLElement Object
                (
                    [resultCode] => Error
                    [message] => SimpleXMLElement Object
                        (
                            [code] => E00027
                            [text] => The referenced transaction does not meet the criteria for issuing a credit.
                        )

                )

            [directResponse] => 3,2,54,The referenced transaction does not meet the criteria for issuing a credit.,,P,0,11077,Register from - website,140.00,CC,credit,127165,User,lastname,,test,test,AK,1545,US,5465,,test25@test.com,,,,,,,,,,,,,,FDE63CE0C30ED433BFD18C86A21F69E7,,,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,
        )

    [response] => 3,2,54,The referenced transaction does not meet the criteria for issuing a credit.,,P,0,11077,Register from - website,140.00,CC,credit,127165,User,lastname,,test,test,AK,1545,US,5465,,test25@test.com,,,,,,,,,,,,,,FDE63CE0C30ED433BFD18C86A21F69E7,,,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,
    [xpath_xml] => SimpleXMLElement Object
        (
            [messages] => SimpleXMLElement Object
                (
                    [resultCode] => Error
                    [message] => SimpleXMLElement Object
                        (
                            [code] => E00027
                            [text] => The referenced transaction does not meet the criteria for issuing a credit.
                        )

                )

            [directResponse] =>3,2,54,The referenced transaction does not meet the criteria for issuing a credit.,,P,0,11077,Register from - website,140.00,CC,credit,127165,User,lastname,,test,test,AK,1545,US,5465,,test25@test.com,,,,,,,,,,,,,,FDE63CE0C30ED433BFD18C86A21F69E7,,,,,,,,,,,,,XXXX4242,Visa,,,,,,,,,,,,,,,,
        )

)

 

I have passed all required parameters for the REFUND process & i also check that in authorize.net that transaction is already setteled. and it passed almost 18 hours but still i got respone "

The referenced transaction does not meet the criteria for issuing a credit 

Please let me know if any thing found wrong in request paramter. 

 

Thanks in advance.

Hello @testing

 

Response code 54:  

 

The referenced transaction does not meet the criteria for issuing a credit. It may be unsettled, an invalid type, the wrong currency, an invalid reference transaction ID or settled more than 120 days ago.

 

Richard

i am using this code to refund CIM transaction. But get an error. Credit card number is required.

Can any tell what is wrong with my code?

public ANetApiResponse RefundTransaction(String ApiLoginID, String ApiTransactionKey, decimal TransactionAmount, string TransactionID)
{
Console.WriteLine("Refund Transaction");

ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = AuthorizeNet.Environment.SANDBOX;

// define the merchant information (authentication / transaction id)
ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()
{
name = ApiLoginID,
ItemElementName = ItemChoiceType.transactionKey,
Item = ApiTransactionKey
};

var transactionRequest = new transactionRequestType
{
transactionType = transactionTypeEnum.refundTransaction.ToString(),
amount = TransactionAmount,
refTransId = TransactionID
};

var request = new createTransactionRequest { transactionRequest = transactionRequest };

// instantiate the contoller that will call the service
var controller = new createTransactionController(request);
controller.Execute();

// get the response from the service (errors contained if any)
var response = controller.GetApiResponse();

//validate
if (response != null && response.messages.resultCode == messageTypeEnum.Ok)
{
if (response.transactionResponse != null)
{
Console.WriteLine("Success, Auth Code : " + response.transactionResponse.authCode);
}
}
else if (response != null)
{
Console.WriteLine("Error: " + response.messages.message[0].code + " " + response.messages.message[0].text);
if (response.transactionResponse != null)
{
Console.WriteLine("Transaction Error : " + response.transactionResponse.errors[0].errorCode + " " + response.transactionResponse.errors[0].errorText);
}
}

return response;
}

saadch8811
Member

Hello @saadch8811

 

It doesn't appear you're including the card expiration date, which can be set to "XXXX" if you do not have it handy.

 

Richard