Custom Payment Gateway Form

I’m developing a custom payment gateway which uses a totally different payment flow for its processing and need some advice on the best approach to adapt invoice plane to this payment gateway approach.

The payment gateway logic entails having the credit card form hosted on the gateway servers…thus I do not need to have a “credit card details” form displayed on the payment_information view. I do however, need to have some custom form input captures and “posted” specifically related for this gateway. Thus the process would be sort of like…

Click on Pay Now Button and either:-

  1. Post custom values to payment gateway URL
  2. Redirect to Custom payment information form which would then post custom values to the payment gateway URL

My idea for this would be require one or more of the following to be considered:-

  1. Modify the payment_information form method to load a custom form
  2. Add a setting for the gateway specifying a custom view with the form
  3. Modify the payment_information view to load a custom form or default to packaged payment_information form
  4. Use custom javascript to manipulate DOM elements based on the payment method selected.

Based on this what would be a good approach to implement?

Are you trying to implement a new payment provider or do you want to fix the current system? I ask because your question started with one and ended with the other topic?


Sorry for not being clear but I am trying to add a new provider specific for my country.

If you want to add a new provider please consider taking a look at the Omnipay documentation. It provides a reliable interface for payments. I do not recommend iplementing a gateway on your own directly in the InvoicePlane core.

Also, check if there already is a driver for your provider.