1

When you need to create a new transaction method for Drupal Commerce, you need to dive into the code. And that's something I have zero experience with. BUT the following couldn't be hard. I already created a new payment module (just copied and edited the payment example module so I have a new payment method).

In commerce_payment_example.module you have the function commerce_payment_ideal_transaction that is been executed by the submit button of the checkout form. The only thing I need to do is to execute a script on submit (in HTML you can do this with <form method="post" action="script.php">, and pass three variables with it: the amount ($charge ?), the order ID ($order->order_id ?) and a description ($order ?). Could someone help me on the right way?

1
  • 3
    I don't know about you, but commerce payment methods are about money. I would totally not be comfortable running a payment method that is hacked by yourself when you have zero experience with programming.
    – Berdir
    Commented Mar 29, 2012 at 20:01

1 Answer 1

1

the transaction is meant to be created on a successful response of your provider (this could be payed, denied or whatever), usually an IPN. meaning you have to provide a MENU_CALLBACK item in hook_menu. most likely information about the order will be posted, make sure you get the order id back.

if you really want that on the payment form submission, just call the method (commerce_payment_ideal_transaction) in the hook_redirect_form. the question here is, how do you decide if a payment was successful or not ;)

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.