Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Custom Gateway Solution Hint!


Guest

Recommended Posts

Posted

If I am right in my thinking this can help many others in using osCommerce for using a custom payment gateway. Let me think aloud ... the following steps should help in this regard:

 

1. Use sample.php in /catalog/includes/modules/payment/ folder to make one's own Payment Mode, so that the order is registered in the database from a valid visitor and present a *new* button to incicate moving to the payment gateway for cc processing!/b]

 

(Now I need help, here ...)

2. Ask customer to click on the *new* button that passes critical data from the database (order id, customer data, order amount, etc.) as form values to the payment gateway page (most of them have it).

 

Then on, the customer remains on the payment gateway's site until he finishes payment and is directed back to osCommerce pages upon completion of transaction.

 

I fervently hope someone comes up to help me do this.

 

Thanks in advance for your time and involvement.

 

Rgds

Sunny

Posted

I think it's a good idea to have a sample payment file.

 

one adjustment, an order_id is not generated until the payment is made. So we have to take the ordernumber from the payment provider and use that order number in oscommerce.

This implicates some problems. (eg what to do if another customer is using osc an places an order and at the same time an onther customer uses a differten payment method and claims the same order_id as generated bij the payment povider...)

 

but i'm willing to help and build a sample.php

Posted

In my case, Order_id is not provided by payment processor. Rather, we have to supply it as a hidden form value from oscommerce to the payment page.

 

Its alright if order id is generated only after the transaction is completed. Let's put the *new button* on the final THANK YOU page with a skate-board graphic. This will further extend the transaction path and from here onwards the customer can be directed to complete payment process on the payment gateway pages.

 

So, the key question is :

 

How to include *the specific* order id, customer *full name* and order_amount behind the button, so that a click on our new button passes these form values to the payment gateway.

 

Any help will be much appreciated.

 

Rgds

Sunny

Posted
Order ID is not generated until the payment is made.

 

The payment mode that we shall make will be a duplicate of Cash on Delivery Module (albeit with a new name), so that the transaction completion page can be reached and then on, the customer gets the *new button* for clicking and going over to the payment gateway page.

 

Looking forward

 

Sunny

Posted

I think the following may help you:

 

Create order id as: $customer_id . '-' . date('Ymdhis')

full name: $order->customer['firstname'].$order->customer['lastname']

order total amount: $order->info['total']

 

kagg

Posted
I think the following may help you:

 

Create order id as: $customer_id . '-' . date('Ymdhis')

full name: $order->customer['firstname'].$order->customer['lastname']

order total amount: $order->info['total']

 

kagg

 

the simplicity of your solution is indeed tempting. I did go ahead and created the following form. But, only the Order ID is passed into the form values, not the customer name and total amount.

 

Does it have to do with the fact that I placed my form button on checkout_success.php page? Does the order info get lost by then? seems like that because, once on this page, the shopping cart becomes empty!

 

<form action="https://www.PaymentGateway.com/shopzone/cc_details.jsp" method="post" name="frm_payup" target="_blank" id="frm_payup" >

           <input type="hidden" name="Order_Id" value="<?php echo $customer_id . '-' . date('Ymdhis'); ?>">

           <input type="hidden" name="Amount" value="<?php echo $order->info['total']; ?>">

           <input type="hidden"name="Merchant_Id" value="-my-id">

           <input type="hidden" name="billing_cust_name" value="<?php echo $order->customer['firstname'].$order->customer['lastname']; ?>"> 

           <input type="hidden" name="billing_cust_address" value=""> 

           <input type="hidden" name="billing_cust_country" value="<?php echo $order->customer['country']; ?>"> 

           <input type="hidden" name="billing_cust_tel" value=""> 

           <input type="hidden" name="billing_cust_email" value=""> 

           <input type="hidden" name="delivery_cust_name" value=""> 

           <input type="hidden" name="delivery_cust_address" value=""> 

           <input type="hidden" name="delivery_cust_tel" value=""> 

           <input name="btn_payup" type="submit" id="btn_payup" value="Proceed to Pay Using Verisign Assured 128-bit Secure Payment Gateway">

           </form>

 

Did I do anything wrong?

Posted

How about using cookies to store orderID, customerName, and orderAMOUNT, while the values still exist in the shopping cart?

 

It is just my wild guess, and I don't yet know how to create cookies or to extract values from them. Once cookies are set in, the Payment Gateway Process Button should call values from cookies earlier set (but on which page?)

 

Again, I just hope someone out there will help me doing just that.

 

Rgds

Sunny

Posted

Add the following line in your page:

 

global $HTTP_POST_VARS, $HTTP_SERVER_VARS, $order, $customer_id;

 

I wish this may help you.

 

kagg

Posted
Add the following line in your page:

 

global $HTTP_POST_VARS, $HTTP_SERVER_VARS, $order, $customer_id;

 

I wish this may help you.

 

kagg

 

Kagg, you seem to be guiding me in the right direction ... but, where which page do I put this line up on? : checkout_success.php, checkout_confirmation.php or what?

 

Is there anyway I can ask others too to help me build up on this.

 

Looking forward,

Sunny

Posted

Add this line in checkout_confirmation.php and then try.

 

Good Luck :)

 

kagg

Posted

Thanks kagg, indeed!

 

But another issues has cropped up :

 

Although hidden form fields are appropriately populated using your tips, yet the customer has yet to come back to shopping cart to confirm the order and clear the shopping cart.

 

In other words,

 

checkout_confirm has *two* buttons:

 

1. Default *CONFIRM* button of osC

2. My new button that opens another window for the gateway page.

 

Now the customer is likely to go over to gateway page and then pay up, but it would have been better if the default *CONFIRM* button was doing both the jobs:

 

1. Sending customer over to the gateway page; as well as,

2. Opening checkout_success page.

 

Am I asking for the moon by expecting one button to do two actions.

 

Any workaround to this issue? Thanks very much in advance.

Posted

You must keep only one button for payment on checkout confirmation page. Either delete the Confirm button of OSC or set the action of Confirm button to your payment gateway. The success page must be returned only after making the payment at your merchant Bank.

 

Kagg

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...