cancel
Showing results for 
Search instead for 
Did you mean: 

C# SDK CreditRequest The credit card number is invalid

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. 

klack
Contributor
5 REPLIES 5

Also I am using a sandbox account

klack
Contributor

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...

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

then use request.Amount, request.CardNum.

request.AddMerchantValue("x_ref_trans_id", txid);

Need to use the addmerchantvalue to add teh x_ref_trans_id.

Working now

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