Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pass value to form_action_url, checkout_confirmation.php


drferrari

Recommended Posts

I need to pass value from my new payment module to check_configuration.php page to form_action_url.

 

I have this value ready in function pre_confirmation_check()

(in: incldes/modules/payments/newpaymentmodule.php)

 

 

Any idea?

Link to comment
Share on other sites

I'm not familiar with that code but you should compare it to an existing module to make sure it has all of the required functions. In order for a payment module to work using the structure in oscommerce, certain functions in the module must be present.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi

 

You can set the checkout_confirmation form using

 

 $this->form_action_url = 'www.blah.com';


  class my_payment module {
   // declare any variables here

    function my_payment_module() {
      global $order;//and any other globals

      //start your $this-> stuff here
      $this->code = 'my_payment_module';
      $this->title = '';
      
      //etc etc
 
      $this->form_action_url = 'http://demo.vivapayments.com/';//  or whatever url you need
    
   
    }

Looking at the wiki link you posted though - try and see if you can get the NON redirect version running - you'd pass the data to the bank in the before_process function of the payment module and could then act on their response without the PITA that is a rediect

 

The authorizenet_aim payment module is an example of that - if you still want the redirect then have a look at authorizenet_sim

Link to comment
Share on other sites

in function function process_button() {

 

I have:

 

$process_button_string =
    tep_draw_input_field('firstname', $fname) .
    tep_draw_input_field('lastname', $lname) .    
    tep_draw_input_field('merchantID', MODULE_PAYMENT_MERCHANTID) .
    tep_draw_input_field ('password', MODULE_PAYMENT_PASSWORD ) .
    tep_draw_input_field('orderId', $orderId) ;
    
    return $process_button_string;

 

 

in checkout_confirmation.php I try get ONLY orderId value.

 

I try something like this echo $process_button = $payment_modules->process_button($orderId); but I get ALL $process_button_string.

 

Any help?

Link to comment
Share on other sites

In file: includes/classes/payment.php I create new function

function get_order_id() {
      if (is_array($this->modules)) {
        if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
          return $GLOBALS[$this->selected_module]->get_order_id();
        }
      }
    }

and in file: incldes/modules/payments/newpaymentmodule.php, I create new function

function get_order_id() {
          global $orderId;
          return $orderId;
      }

in file: checkout_confirmation.php after if (isset($$payment->form_action_url)) {

 

add this

$get_order_id = $payment_modules->get_order_id();
      
      if (tep_not_null($get_order_id)) {
          echo $form_action_url = $$payment->form_action_url . $get_order_id;
      }else{
          echo $form_action_url = $$payment->form_action_url;
      }

now you get form_action_url with parameters, this parameters is taken if you have right MerchantId, APIKey, Get the curl session object, Set the POST options, Parse the JSON response, Look to create_order.php file, https://github.com/VivaPayments/API/tree/master/CreateOrder/PHP.

 

I want ask if this is right approach to create this payment module?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...