1

I have a module that allows authenticated users to book a "Facility" and then pay for it online. The module that facilitates the online payment is different from the booking module.

In the booking module I accept the details from the "authenticated" user in a form and in submit function I store the record in the DB with the following code

$form['$source'] = array(
  '#type' => 'hidden',
  '#default_value' => 'obb',
);

$form['uv_amount'] = array(
  '#type' => 'hidden',
  '#default_value' => $amount_final,
);

$form['description1'] = array(
  '#type' => 'hidden',
  '#default_value' => 'OBB - Booking Charges for ' . $hall_type_code . ' ON ' . $arri_date,
);

$form['#method'] = 'post';
$form['#action'] = '/mymodule/pgi/confirm';

In the module that handles the payment gateway I pass these values to the payment gateway after calculating the mandatory HASH values etc (as per the payment gateway integration document)

During testing I figured out that the values are not being posted to the PG page. Is there a way to post the values to the PG page after I store the booking/reservation details in the form submit function? Or is there a better way of accomplishing this. Would appreciate any help.

0

It sounds like you are doing a multi step form (given the URL in your form is "confirm"). You don't want to be looking at $_POST values, you'll want to utilize FormAPI all the way through.

See for examples:

http://www.sitepoint.com/building-multi-page-wizard-like-form-drupal/

http://jamesdavidson.io/blog/how-create-multi-step-form-drupal-7

http://www.webomelette.com/ctools-object-cache-multi-step-form

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.