1

I need to create an iframe to my payment provider that will do the actual payment in the checkout process of Drupal commerce.

In this iframe the user will actually insert his credit card details.

What is the best way to accomplish this?

I need this (of course) to interact with the commerce checkout process.

3
  • Did you get a solution for this? Commented Jun 8, 2014 at 9:05
  • Nope... Still looking for some help on this topic
    – doron
    Commented Jun 8, 2014 at 11:35
  • I might have found a solution. Let me test it further then provide an answer. Commented Jul 14, 2014 at 4:56

2 Answers 2

2

I did create a Commerce payment gateway with an almost similar challenge. You can have a look at the Commerce Pesapal module code.

A brief description would be;

  1. Register a Commerce payment method.
  2. Create settings for your payment method if any.
  3. Implement hook_menu()and create at least three pages. One to hold the iframe, one to hold the callback from the payment gateway and another that will hold the form used to pass values to the iframe. The second page can also be used to pass a message to the user.
  4. On the redirect form you will not use a 'Submit' button because we need to pass the values to an internal URL. Instead you will do something like this.

    $form['#action'] = $base_path.'Path To Your Iframe';
    $form['actions'] = array('#type' => 'actions');
    $form['actions']['submit'] = array(
     '#type' => 'submit',
     '#value' => 'Pay',
    );
    
  5. On the iframe page you can get all the variables rom your redirect from using $_GET.

The rest of the details I believe will depend on the gateway provider from that point on.

1

Quite an old question, but if anyone still faces this issue, here are few example payment method modules apparently implementing iframe integration:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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