ASPX templates
Version 5.x > ASPX templates > Customized CMSPaymentGatewayProvider View modes: 
User avatar
Member
Member
nicolas.juteau-nexun - 6/23/2011 3:43:09 PM
   
Customized CMSPaymentGatewayProvider
Hello Kentico team,

We are currently designing a customized payment gateway provider to work with psigate and are having problem settings the PaymentResult datas into the cms database.

Here is the relevant snippet of code we are using:

public override void ProcessPayment()
{
// custom code ...

PsigateGateway gateway = new PsigateGateway();

NameValueCollection nvc = new NameValueCollection();
nvc.Add("Subtotal", "79");
nvc.Add("CardNumber", "4111111111111111");
nvc.Add("CardExpMonth", "02");
nvc.Add("CardExpYear", "12");

doc = gateway.DoPreAuth(nvc);

// Code ommited here ....

PaymentResultItemInfo inf1 = new PaymentResultItemInfo();
inf1.Header = "{$AuthorizeNet.AuthorizationCode$}";
inf1.Name = "authorizationcode";
inf1.Value = gateway.ResponseAuthCode;

this.PaymentResult.SetPaymentResultItemInfo(inf1);

//this.UpdateOrderPaymentResult();
}

As explainded in the E-commerce guide, we are using the SetPaymentResultItemInfo method to create xml nodes that makes the PaymentResultInfo object, but unfortunately even with the UpdateOrderPaymentResult method, it does not actually saves it to the database.

What are we actually making wrong? Any advice would be very appreciated.

Best Regards,

User avatar
Member
Member
nicolas.juteau-nexun - 6/27/2011 10:36:52 AM
   
RE:Customized CMSPaymentGatewayProvider
If useful for anyone, in the debugging process, the following call to the method UpdateOrderPaymentResult throws the following exception:

Unable to update order payment result. Order was not specified

User avatar
Member
Member
nicolas.juteau-nexun - 6/27/2011 10:58:46 AM
   
RE:Customized CMSPaymentGatewayProvider
Found the problem.

Before adding the payment results datas, call the following methods:

this.AddAdditionalInfoToPaymentResult();


This post is now marked as SOLVED :)