Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Contributor
Posts: 11
Registered: ‎12-11-2012

C# SDK CreditRequest The credit card number is invalid

[ Edited ]

I'm having some issues doing a credit request using the C# SDK.  Here is the code I am using:

 

            var txid = "2181163453";
            var amount = 1.0M; var lastfour = "1111"; //test account var apilogin = "xxx"; var transkey = "xxx"; var request = new CreditRequest(txid, amount, lastfour); var gate = new CardPresentGateway(apilogin, transkey, true); var response = (CardPresentResponse)gate.Send(request);

 I get a 

 

The credit card number is invalid

 

error message using the last four.  If i enter a full credit card number it tells me to enter an exipration date.  I don't understand, it should just take the txid and work. 

Contributor
Posts: 11
Registered: ‎12-11-2012

Re: C# SDK CreditRequest The credit card number is invalid

Also I am using a sandbox account

Contributor
Posts: 11
Registered: ‎12-11-2012

Re: C# SDK CreditRequest The credit card number is invalid

Looks like a bug in the SDK.  I'm looking at the post values being sent and it is sending x_trans_id instead of x_ref_transid

 

Looking for a workaround...

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

Re: C# SDK CreditRequest The credit card number is invalid

If you are using the Credit Present API, use the CardPresentCredit

then use request.Amount, request.CardNum.

Contributor
Posts: 11
Registered: ‎12-11-2012

Re: C# SDK CreditRequest The credit card number is invalid

request.AddMerchantValue("x_ref_trans_id", txid);

Need to use the addmerchantvalue to add teh x_ref_trans_id.

Working now

Contributor
Posts: 11
Registered: ‎12-11-2012

Re: C# SDK CreditRequest The credit card number is invalid

Ah yes i seen this method but it didn't have input params for amount and cardnum.  The SDK needs some better documenation!