0

We created the custom payment gateway for our site inheriting the CMSAuthorizeNetProvider class and added the parameter

requestParams["TYPE"] = "RECURING" in the InitializePaymentRequest method

i have confusion of how to intimate the my payment is recurring or not to gateway or shoppingcart

Thankyou

2 Answers2

1

You can store the parameters in your shoppingcarcustomdata object and then pull them out in your gateway code. You could add the recurring, term, and start date to the custom data and then have them available when you need them. It stores them as xml, so it should be easy to pull the values out as well.

Josh
  • 156
  • 1
  • Thankyou @Josh can you explain with the small piece of code – Gopi krishna ch Jun 02 '16 at 13:33
  • //code that gets value from ordercustomdata field ValidationHelper.GetString(order.OrderCustomData.GetValue("Attendees"), "") //code that sets the same field in the order order.OrderCustomData.SetValue("Attendees", "testattendee"); – Josh Jun 02 '16 at 13:52
1

Assuming you are using Kentico 8+ and the new Checkout process that came with it, the best approach would be to create your own CMSCheckoutWebpart (more information with examples here) along with a custom field in your Shopping cart to hold the data.

For this you need to extend the default shopping cart with a custom field in Modules -> E-commerce -> Classes -> Shopping cart -> Fields with a custom field which would hold the information about your payment or anything else.

In the web part above you can set the value of some field in the current shopping cart very easily using something like:

ShoppingCart.SetValue("CustomFieldName", "value");

The approach with ShoppingCartCustomData is perfectly valid as well. The only disadvantage is that if you wish to store more data in there you will need to store them using XML/Json and then work with this.

Enn
  • 2,137
  • 15
  • 24