0

My users have to be guided to Bank Gate to pay the money After filling a Form in my custom module. the process of leading them has to be done through NUSOAP but it seems it is not functioaning inside module! it works find when i have the same code in a php file but in module ... I have no idea what is wrong with that! this is my submit function:

function my_module_my_form_submit($form, &$form_state) {

  $nusoap_path = drupal_get_path('module', 'myblock') . '/nusoap.php';
  include_once($nusoap_path);

    $client = new nusoap_client('https://de.....com/pg/services/WebGate/wsdl', 'wsdl'); 
    $client->soap_defencoding = 'UTF-8';
    $result = $client->call('PaymentRequest', array(
                                                    array(
                                                            'MerchantID'    => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
                                                            'Amount'        => 1000,
                                                            'Description'   => 'some texts',
                                                            'CallbackURL'   => 'http://......./verify.php'
                                                        )
                                                    )
    );
    //Redirect to URL
    if($result['Status'] == 100)
    {
        $form_state['redirect'] =('https://www.......com/pg/StartPay/'.$result['Authority']);
    } else {
        echo'ERR: '.$result['Status'];
    }

}

thanks in advanced for you help

0

I think I've had a similar issue in the past with a different payment gateway.

Inspect each variable (print_r or var_dump) one after another comparing the values between your stand alone php file and the drupal module.

When you find the point at which there is a difference you know what line it's going wrong.

Maybe shout at it a bit at this point, give it a prod, read some more API documentation and then you should almost be there ;)

| improve this answer | |
0

my mistake was trying to do it on localhost! once i checked the same code on a real server everything was fine and it worked!

| improve this answer | |

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.