Hello,
I have implemented DoVoid() method in my custom PaymentGateway.dll following the Authorize.NET example. In the same file (PaymentGateway.dll) there is DoAuthorize() and other DoXXX() methods that work successfully when "Pay with card" button is clicked on the shopping cart checkout screen. However the DoVoid() method is never fired when the "Void" button is clicked on the Admin screen for voiding transactions. Is there something that needs to be added on the void transactions screen code behind?
thanks!
Void a Transaction
Re: Void a Transaction
Additional details:
I'm using Able Commerce gold
Code snippets:
public override Transaction DoVoid(VoidTransactionRequest voidRequest)
in PaymentGateway.cs:
.................................
public override Transaction DoVoid(VoidTransactionRequest voidRequest)
{
this.RecordCommunication(this.Name, CommunicationDirection.Receive, "--------------DoVoid() ---------", null);
//BUILD THE REQUEST
string gatewayRequest = BuildGatewayRequest_Void(voidRequest);
//RECORD REQUEST
if (this.UseDebugMode)
{
//ALWAYS MASK THE CREDENTIALS
string credentials = String.Format("x_login={0}&x_tran_key={1}", this.MerchantLogin, this.TransactionKey);
string debugCredentials = "x_login=xxxxxxxx&x_tran_key=xxxxxxxx";
this.RecordCommunication(this.Name, CommunicationDirection.Send, gatewayRequest.Replace(credentials, debugCredentials), null);
}
//SEND REQUEST
string response = this.SendRequestToGateway(gatewayRequest);
//RECORD RESPONSE
if (this.UseDebugMode) this.RecordCommunication(this.Name, CommunicationDirection.Receive, response, null);
//PROCESS RESPONSE AND RETURN RESULT
return this.ProcessGatewayResponse_Void(voidRequest.Payment, response, voidRequest);
}
................................
in VoidPayment.aspx.cs:
protected void SubmitVoidButton_Click(object sender, EventArgs e)
{
_Payment.Void();
if (!string.IsNullOrEmpty(CustomerNote.Text))
{
OrderNote note = new OrderNote(_Order.Id, AbleContext.Current.UserId, DateTime.UtcNow, CustomerNote.Text, NoteType.Public);
_Order.Notes.Add(note);
_Order.Save(false, false);
}
Response.Redirect("Default.aspx?OrderNumber=" + _Order.OrderNumber.ToString());
}
..............
As I have mentioned above the DoVoid() method is never called.
Please advise!
Thanks in advance,
Lena
I'm using Able Commerce gold
Code snippets:
public override Transaction DoVoid(VoidTransactionRequest voidRequest)
in PaymentGateway.cs:
.................................
public override Transaction DoVoid(VoidTransactionRequest voidRequest)
{
this.RecordCommunication(this.Name, CommunicationDirection.Receive, "--------------DoVoid() ---------", null);
//BUILD THE REQUEST
string gatewayRequest = BuildGatewayRequest_Void(voidRequest);
//RECORD REQUEST
if (this.UseDebugMode)
{
//ALWAYS MASK THE CREDENTIALS
string credentials = String.Format("x_login={0}&x_tran_key={1}", this.MerchantLogin, this.TransactionKey);
string debugCredentials = "x_login=xxxxxxxx&x_tran_key=xxxxxxxx";
this.RecordCommunication(this.Name, CommunicationDirection.Send, gatewayRequest.Replace(credentials, debugCredentials), null);
}
//SEND REQUEST
string response = this.SendRequestToGateway(gatewayRequest);
//RECORD RESPONSE
if (this.UseDebugMode) this.RecordCommunication(this.Name, CommunicationDirection.Receive, response, null);
//PROCESS RESPONSE AND RETURN RESULT
return this.ProcessGatewayResponse_Void(voidRequest.Payment, response, voidRequest);
}
................................
in VoidPayment.aspx.cs:
protected void SubmitVoidButton_Click(object sender, EventArgs e)
{
_Payment.Void();
if (!string.IsNullOrEmpty(CustomerNote.Text))
{
OrderNote note = new OrderNote(_Order.Id, AbleContext.Current.UserId, DateTime.UtcNow, CustomerNote.Text, NoteType.Public);
_Order.Notes.Add(note);
_Order.Save(false, false);
}
Response.Redirect("Default.aspx?OrderNumber=" + _Order.OrderNumber.ToString());
}
..............
As I have mentioned above the DoVoid() method is never called.
Please advise!
Thanks in advance,
Lena
Re: Void a Transaction
Make sure you marked in SupportedTransactions property of provider that it supports the Void transactions.
Re: Void a Transaction
It is marked as True but the Void method is not being called. Please help!
Thanks
Thanks
Re: Void a Transaction
By this I seems like you are saying Void is included in supportedTransactions. For example if provider is supporting Authorize, AuthorizeCapture, Capture, PartialRefund, Refund and Void transactions then SupportedTransactions will be overridden in following way
Then make sure all supported transactions are handled for example for Void make sure you have overridden the DoVoid handle like this
Now in testing if you have a successfully authorized transaction and you trigger a void system should call DoVoid.
Code: Select all
public override SupportedTransactions SupportedTransactions
{
get
{
return (SupportedTransactions.Authorize | SupportedTransactions.AuthorizeCapture | SupportedTransactions.Capture | SupportedTransactions.PartialRefund | SupportedTransactions.Refund | SupportedTransactions.Void);
}
}
Code: Select all
public override Transaction DoVoid(VoidTransactionRequest voidRequest)
{
// YOUR CUSTOM CODE HERE
}