ASPX templates
Version 7.x > ASPX templates > Paypal direct payment View modes: 
User avatar
Member
Member
mantis - 3/19/2013 9:54:49 AM
   
Paypal direct payment
Hey,

I am trying to integrate ecommerce to existing site. Only what we need is to sell single product (basically - membership).

I have configured ecommerce module, I was able to display these products on the site.. however - now I need to make order and make direct payment to paypal.
I don't need cart here.
I am using product options for selling to client.
I found one thread about doing direct payment to paypal, but it seems outdated and does not work with kentico 7 (some objects are missing, or methods are different).

So I made custom checkout step.. but when I call

this.ShoppingCartControl.PaymentGatewayProvider.ProcessPayment();

I get an error:
[NullReferenceException: Object reference not set to an instance of an object.]
CMS.Ecommerce.OrderInfoProvider.GetInvoiceNumberInternal(OrderInfo order) +6
CMS.Ecommerce.ShoppingCartInfoProvider.GetShoppingCartResolverData(ShoppingCartInfo cart) +1002
CMS.Ecommerce.ShoppingCartInfoProvider.GetShoppingCartResolverInternal(ShoppingCartInfo cart, Boolean specialMacros) +298
CMS.Ecommerce.PaymentOptionInfoProvider.ResolveUrlMacrosInternal(String url, ShoppingCartInfo cartObj) +117
CMS.EcommerceProvider.CMSPayPalProvider.ProcessPayment() +74
CMSApp.CMSTemplates.Ecommerce.DirectPaypalPayment.Page_Load(Object sender, EventArgs e)

Any ideas on how to implement it correctly?
After successful payment I also want to assign sold membership to user..

any help is appreciated.

regards
Mantas

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/30/2013 12:51:36 PM
   
RE:Paypal direct payment
Hi,

I would follow the idea you have found for older version. It is still the same and you just need to adjust the API changes:

5.5R2 -> 6 changes

6 -> 7 changes

Regarding your code - it is the most general .Net message that some object is null in your code. You may need to run it in the debug mode to see which one is null and add appropriate check in your code.

Best regards,
Juraj Ondrus