drupalmodulepaymentdrupal-commercecommerce

Drupal Commerce: How to create a payment method?


I'm trying to create a Drupal Commerce payment module for our company's special payment service, and implementation for Magento was pretty painless, but for Drupal Commerce, it's been a magical ride of confusion the entire ride, or maybe I'm not used to Drupal Commerce.

I've set up Drupal Commerce Kickstart and I'm trying to figure out how to set up a skeleton payment module ready to hook into Drupal Commerce, but the documentation i've come accross is.. well.. to put it nicely (no need to start a fire): it could use some work.

Maybe I'm looking in all the wrong places, but I'm unable to find some clear and to the point documentation about writing payment method modules for Drupal Commerce. Can anyone point me to a 'Drupal Commerce Payment Method Programming for Dummies' before I lose the remains of my sanity? :)

I've read all relevant documentation on the Drupal Commerce website, but it either just talks about payment modules in general or the pages that actually talk about how to create these payment method modules lack information, are really badly written or just plain don't exist yet.

UPDATE: I've dropped this project.. IMHO, Drupal Commerce is a complete fail.. my free advice to the world: please use Magento or some other serious E-commerce suite instead of Drupal Commerce.


Solution

  • As jbennecker said, there are some modules you can use for payment. The commonly used module is Drupal's payment module. If you want to specially use payment for Drupal's e-commerce, then I suggest you using the modules showed at the Drupal Commerce site. These are single modules if you already installed e-commerce module.

    They also say what you have to do to install these modules, and what you'll need to use it. Like at PayPal, you need to have a PayPal account that connects to the module with a gateway solution to receive payments.

    UPDATE

    Try reading this instruction. You also need hook_commerce_payment_method_info() which you can learn more about here.

    Be sure to pay attention to the part "Special notes for off-site payment methods".

    Sorry i misunderstood your question, I was able to write a payment module reading the instructions above.

    Hope that helps, if any question you have, comment and I'll help if I can.