need help in return values from my custom payment page and prosses to next step

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anni tempo fa
Hi all

Here is my payment scenario

1: on checkout I select my payment
2: my payment will redirect me to another page with the total price (i.e http://localhost/myPayment.aspx?total=20.00)

here is my payment code

protected void Page_Load(object sender, EventArgs e)
    {
        ShoppingCart Cart = ShoppingCartManager.GetCurrentShoppingCart(ShoppingCartTypeEnum.ShoppingCart);
        decimal shoppingCartSubTotalDiscount;
        decimal shoppingCartSubTotal = ShoppingCartManager.GetShoppingCartSubTotal(Cart, NopContext.Current.User, out shoppingCartSubTotalDiscount);
        decimal shoppingCartSubTotalConverted = CurrencyManager.ConvertCurrency(shoppingCartSubTotal, CurrencyManager.PrimaryStoreCurrency, NopContext.Current.WorkingCurrency);
        decimal total = shoppingCartSubTotal;
        Response.Redirect("https://localhost/knet-aspx/payonload.aspx?total=" + shoppingCartSubTotal);
    }


now, after the payment is complete i'll get to page "MyCustomPaymentResult.aspx" showing me the result of my payment, from here I need to get back to nopCommerce website and go to complete page (CheckoutCompleted.aspx.
How can I return the payment parameters value to nopCommerce and the value true so I can continue to complete page?
i'll get values from page "MyCustomPaymentResult.aspx" and need to store them in "orders" table


By viewing the other payment methods i found this

public PaymentInfo GetPaymentInfo()
    {

    }


and


public bool ValidateForm()
    {

    }


Do I need to do something here?

Please Help me out
14 anni tempo fa
Please guys I really need to finish this on Sunday :(

Help please
14 anni tempo fa
umm is my question so hard or is not clear ?
please if anyone know please help me
14 anni tempo fa
I'm not sure what you're trying to do. But here's a step list to create new payment gateway:

1) Create new class for your payment gateway (implement IPaymentMethod interface)
2) Create new user control that implements IPaymentMethodModule interface and place it into \NopCommerceStore\Templates\Payment\[FolderName]. It'll be displayed to customers.
3) Create new user control that implements IConfigurePaymentMethodModule interface and place it into \NopCommerceStore\Administration\Templates\Payment\[FolderName]. It'll be used to configure your payment gateway.
4) Add an appropriate record to "Nop_PaymentMethod" table. You can do it via admin panel (Orders/Payments -> Payment Methods).
14 anni tempo fa
Thanks for reply

but it still hard to me to do it, can i send you the files and you do it to me please?

I'm so despaired :(
13 anni tempo fa
Can you email a sample of this?
I need to implement a payment process for turkish credit card system. We have also installment options.

Another point is - is it possible to set the payment type according to a coupon code or customer role?

Thank you
13 anni tempo fa
nopCommerce team | a.m. wrote:
I'm not sure what you're trying to do. But here's a step list to create new payment gateway:

1) Create new class for your payment gateway (implement IPaymentMethod interface)
2) Create new user control that implements IPaymentMethodModule interface and place it into \NopCommerceStore\Templates\Payment\[FolderName]. It'll be displayed to customers.
3) Create new user control that implements IConfigurePaymentMethodModule interface and place it into \NopCommerceStore\Administration\Templates\Payment\[FolderName]. It'll be used to configure your payment gateway.
4) Add an appropriate record to "Nop_PaymentMethod" table. You can do it via admin panel (Orders/Payments -> Payment Methods).


Can you email a sample of this?
I need to implement a payment process for turkish credit card system. We have also installment options.

Another point is - is it possible to set the payment type according to a coupon code or customer role?

Thank you
13 anni tempo fa
I used the WorldPay Routines and here's what I did in my return after checking for success. Notice i create a new MarkOrderAsPaid method that took the order, payment return values and status. Also I changed my checkoutcompleted to accept an orderID as parameter as it may not always be the last oredr that is completed because I have implemented a make payment routine to send the order payment again if a problem and try again and then display the correctly completed order if success.

Order order = OrderManager.GetOrderById(Convert.ToInt32(orderInfo));
                    if (order == null)
                        throw new NopException(string.Format("The order ID {0} doesn't exists", orderInfo));

                    if (order.CustomerId != NopContext.Current.User.CustomerId)
                        throw new NopException("Not your order");

                    if (instanceID.Trim() != merchTxnRef.Trim())
                        throw new NopException(string.Format("The Instance ID (0}) received for order {1} does not match the Instance ID stored in the database ({2})", merchTxnRef, order.OrderId, instanceID));

                    //* Store the returned data in the order

                    ProcessPaymentResult ProcessPaymentResult = new ProcessPaymentResult();

                    ProcessPaymentResult.AuthorizationTransactionCode = acqResponseCode;
                    ProcessPaymentResult.AuthorizationTransactionId = authorizeID;
                    ProcessPaymentResult.AuthorizationTransactionResult = receiptNo;
                    ProcessPaymentResult.CardType = cardType;
                    ProcessPaymentResult.CaptureTransactionId = transactionNr;
                    ProcessPaymentResult.CaptureTransactionResult = receiptNo;

                    if (OrderManager.CanMarkOrderAsPaid(order))
                        {
                            OrderManager.MarkOrderAsPaid(order, ProcessPaymentResult, OrderStatusEnum.Complete);
                        }

                    Response.Redirect("~/CheckoutCompleted.aspx?OrderID=" + order.OrderId.ToString());
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.