cancel
Showing results for 
Search instead for 
Did you mean: 

Sandbox C# .NET Card Not Present Transactions

I am using C# .net and setting up an application that processes credit cards over the internet. I would like to switch from Card Present, to Card Not Present (or just standard Gateway as I understand it). This is what authorize.net support recommended in this situation. However I do not understand how to complete a transaction via the standard gateway.

 

with the Card Present gateway I use:

CardPresentAuthorizeAndCaptureRequest

 

But I don't see any functions for CardNotPresentAuthorizeAndCaptureRequest.

There is a Capture Request but this asks for an Auth Code which I don't have from user input. 

 

Do I have to first seperately authorize and then capture?

 

Could somebody help me convert my Card Present Code to standard Gateway request code for a card not present standard gateway request?

 

CardPresentGateway target = new CardPresentGateway( _apiLogin, _transactionKey, true );

IGatewayRequest request = new CardPresentAuthorizeAndCaptureRequest( amount, cardNumber, cardMonth.ToString(), cardYear.ToString() );

IGatewayResponse actual = target.Send( request );
return new PaymentResponse( actual.ResponseCode, actual.Message );

 

bobbydoogle
Contributor
4 REPLIES 4
RaynorC1emen7
Expert

This is helpful, so can I just run a CaptureRequest to accomplish this? I'm a bit confused by the auth code, in the SendTest_Capture_Approved() example they set it to 

 

string authCode = SendAuthOnly(amount + 1, false);

 

I don't understand the logic here, is the amount + 1 becoase the auth code can be any valid value for a capture request? Do I have to run a seperate authorization prior to a capture? I would prefer to do all in one step.

string authCode = SendAuthOnly(amount + 1, false);

they doing a test, you will need to pass in your own amount.

 

if you are doing auth_capture before, use the one that do auth_capture.

 

Our tests increment each test transaction by a dollar just as a simple way to avoid the duplicate transaction filter without sending any additional parameters.

 

Thanks,

Joy