Passing a value from paymentmodule.ascx to PostProcessPayment()

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 12 años
Hello,
I'm new to nopCommerce and I would like to know which is the correct way to pass a value from the web page paymentmodule.ascx where I have added a combobox to the PostProcessPayment(Order order).

The way I tried to do it is by storing the value in paymentInfo.RecurringTotalCycles but i don't know the correct way to
access this value from the PostProcessPayment method.

Any help will by appreciated
thnx.
Hace 12 años
The way you do it right now is to mis-use a field. This is not the most proper way to do it, but it might work.

Do you need the value only while processing the order? Or do you want to store the value with the payment information?

If you only need it while processing the order, you can transfer the value using the Session object.
If you need to store it with the payment information, you might want to store it in a field that usually is used for something else. The field RecurringTotalCycles might be the way to go if you have set your payment method to NOT support cycles.
Hace 12 años
linkXperts wrote:
The way you do it right now is to mis-use a field. This is not the most proper way to do it, but it might work.

Do you need the value only while processing the order? Or do you want to store the value with the payment information?

If you only need it while processing the order, you can transfer the value using the Session object.
If you need to store it with the payment information, you might want to store it in a field that usually is used for something else. The field RecurringTotalCycles might be the way to go if you have set your payment method to NOT support cycles.


Thank you for your prompt answer.
Since i don't care about persisting the value, i will try the session at the end but i really would like to read it from the class paymentinfo if it's 2-3 lines of code ;) .
So should I do something in the method ProcessPayment(PaymentInfo paymentInfo, Customer customer, Guid orderGuid, ref ProcessPaymentResult processPaymentResult) which  gives me paymentinfo or can i get paymentinfo directly from PostProcessPayment(Order order) where is the place i want to use it.

Ps. In the payment module I just did paymentInfo.RecurringTotalCycles = Convert.ToInt32(dlInstallments.Text);
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.