Creating commerce iframe payment 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.
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;


Register a Commerce payment method.
Create settings for your payment method if any.
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.
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' =&gt; 'actions');
$form['actions']['submit'] = array(
 '#type' =&gt; 'submit',
 '#value' =&gt; 'Pay',
);

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.