cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Specific Transaction Responses

Using the Sandbox Account Error Generation Guide, developers can trigger specific transaction responses in the sandbox including approvals, declines, errors, as well as AVS and Card Code responses.

 

Use this thread for discussion: http://community.developer.authorize.net/t5/Integration-and-Testing/Triggering-Specific-Transaction-...

 

Richard

Michelle
All Star
53 REPLIES 53

I am trying to trigger error responses and can't get the gateway to return anything but OK.

 

I have verified that the sandbox account is in live mode. 

I have tried the following test card numbers:

  • 370000000000002
  • 6011000000000012
  • 4111111111111111

.. in combination with the postal code: 46282

 

I have even tried a real credit card with the 46282 postal code and an invalid cvv, and it still succeeds.

 

What am I doing wrong?

codasaurus
Contributor

Which API? and how did you send the zip code?

Ah yes, more details are in order.

 

I'm using the CIM api.

 

We have a page in the user account settings area where the user can manage payment methods. On that page is a form that takes a Card Nickname, Name on Card, Card Number, Zip Code, CVV, Expiration Month, Expiration Year.

 

That form is submitted to the server, where the complete data set is built out and set into a new AuthorizeNetPaymentProfile object, which is subsequently passed into AuthorizeNetCIM::createCustomerPaymentProfile(), the result of which is stored in a table along with the CustomerProfile Id returned from AuthorizeNetCIM::createCustomerProfile().

 

These two values, the CustomerProfileId and CustomerPaymentProfileId are retrieved and set on a new AuthorizeNetTransaction instance when a charge is to be made. The recurringBilling property is set to true

 

As a little background, this is not my code, and this is my first experience with the authnet api (or any other payment gateway for that matter). I'm trying to fix the way the original developer is handling transaction failures.

Oh, the transaction is submitted via AuthorizeNetCIM::createCustomerProfileTransaction("AuthCapture", $transaction);

I've also noticed on sandbox.authorize.net that all transactions except those made to 4111111111111111 get flagged as "Captured/Pending Settlement".

 

If my sandbox is in live mode, I should be able to push through bad card data and get errors, shouldn't I?

I have even tried a real credit card with the 46282 postal code and an invalid cvv, and it still succeeds.

when you said succeeds, do you mean I00001? or the directResponse start with 1,1,..... ?

 

I've also noticed on sandbox.authorize.net that all transactions except those made to 4111111111111111 get flagged as "Captured/Pending Settlement".

So, what happend to the 4111111111111111 transactions?

 

If my sandbox is in live mode, I should be able to push through bad card data and get errors, shouldn't I?

Yes, you should got error. Can you login to the test merchant account and see if the zip code is there for the "Captured/Pending Settledment" transactions.

 

 


@RaynorC1emen7 wrote:

 

> when you said succeeds, do you mean I00001? or the directResponse start with 1,1,..... ?

 

AuthorizeNetCIM_Response:

 

xml->directResponse = "1,1,1,This transaction has been approved.,QDY6KL,Y,2181241310,,,71.29,CC,auth_capture,123456789,Henrietta,Lark,Joses Plumbing,,Indianapolis,IN,46282,United States,,,jose@joses.com,,,,,,,,,,,,,,9D628E8E6A39A30CF851BA393D036084,,2,,,,,,,,,,,XXXX0012,Discover,,,,,,,,,,,,,,,,"

 

xml->messages->resultCode = "Ok"

 

response property contains: ... <code>I00001</code><text>Successful.</text>

 

I guess to answer your question directly, "yes, both" ;)

 

> So, what happend to the 4111111111111111 transactions?

 

They were settled. This morning when I logged in, all the transactions that were unsettled yesterday have now been settled as well.

 

> Yes, you should got error. Can you login to the test merchant account and see if the zip code

> is there for the "Captured/Pending Settledment" transactions.

 

Name:Henrietta Lark
Company:Joses Plumbing
Address: 
City:Indianapolis
State/Province:IN
Zip Code:46282
Country:United States

 

 


 

I just try it with a test CIM account, and it work fine(getting a decline) when the zip code is 46282. And I tried with 6011000000000012 and 4111111111111111.

 

Can you post how you calling the CIM createtransaction?

 

 

Sorry for the delay, holidays and sickness :mansad:

 

// First, we build the transaction:

$transaction = new AuthorizeNetTransaction;

$transaction->customerProfileId = $customer->ProfileId;
$transaction->customerPaymentProfileId = $customer->ProfilePaymentId;
$transaction->recurringBilling = true;

 

// add line items

$lineItem1 = new AuthorizeNetLineItem;

...

$transaction->lineItems[] = $lineItem1

...etc

 

$transactionRequest = new AuthorizeNetCIM;
$transactionResult = $transactionRequest->createCustomerProfileTransaction("AuthCapture", $transaction);

 

It work, if I DON'T set the recurringBilling = true.