Hi all ,
for now what i'm doing - is sending my values to a function called "CheckPayment"
where i authorize the request using the AIM as such :
decimal total = (decimal)_orderTotalCalculationService.GetShoppingCartTotal(cart); var request = new AuthorizeNet.AuthorizationRequest(cc_number, cc_date, total, "customer : " + _workContext.CurrentCustomer.Id + " verify card details", false); var gate = new AuthorizeNet.Gateway(ConfigurationManager.AppSettings["loginId"], ConfigurationManager.AppSettings["transactionKey"]);
var response = gate.Send(request);
if (response.Approved)
{
return Json(new { Status = "success", info = response });
}
then i save the AuthorizationCode in a JS variable , after the user is confiming his order , and click ( after another stage ) "Submit" - i send again the card number,date and authorizationCode all over again - when i only Capture the paymentm
here is the code :
public AuthorizeNet.GatewayResponse ClearPayment(string cc_number, string cc_date, string authorizationCode, decimal amount, string cc_code = "") { var capture = new AuthorizeNet.CaptureRequest(authorizationCode, cc_number, cc_date, amount); capture.Type = "CAPTURE_ONLY"; var gate = new AuthorizeNet.Gateway( ConfigurationManager.AppSettings["loginId"], ConfigurationManager.AppSettings["transactionKey"]); var response = gate.Send(capture); return (AuthorizeNet.GatewayResponse)response; }
the result is :
that's work - but i'm sure there is a better way - can't i send the transactionId with the authorizationCode and so instead of having 2 transacions - the one that was waiting for the Capture - would change it's status ?
can someone show me an example of how to do so ?
any help would be appriciated , thanks.
Solved! Go to Solution.
12-07-2014 05:27 AM
You can use the "Prior Authorization and Capture" which only required the transactionID
but couldn't you confirm the order first, then do a auth_capture transaction?
12-07-2014 06:32 AM
You can use the "Prior Authorization and Capture" which only required the transactionID
but couldn't you confirm the order first, then do a auth_capture transaction?
12-07-2014 06:32 AM
first of all thanks - i did a little manuver but it worked :) .
i've set a new CaptureRequest , then set the Type = "PRIOR_AUTH_CAPTURE" .
did the trick, i guess with a little more effort i would even maybe extend the GateWay Request...
i left with another Question though .
how can i "force" the card check - to validate the cvv code ?
12-07-2014 07:43 AM