Skip to content

Technical docs

Hasan Hasanzade edited this page Aug 21, 2024 · 6 revisions

How to add new async payment method

  1. Add payment method main class file in includes/payment-gateways. Follow the class structure and naming (Ctrl+C & Ctrl+V 😉) from other async payment methods (i.e. Credit Card). Shortcode, name, description should be defined in this file.
  2. Include that file in the init() method of plugin base class file - bp-plugin-woocommerce-api2.php. Then add it to $methods array in add_betterpayment_gateways().
  3. Generate, translate and compile strings (name & description). Run the following command to generate .pot file. Make sure wp-cli is intalled and configured beforehand.
wp i18n make-pot . languages/bp-plugin-woocommerce-api2.pot

As a result new strings should be added to .pot file. Using Poedit load existing language's .po file from .pot file, then add translations. It should automatically compile into .mo file.

I guess that's it :)