Custom Payment Gateway

WCMp Vendor Membership

Custom Payment Gateway Resolved

Viewing 4 reply threads
  • Author
    • #102095
      Espen Kvelland

      We are Tanzania based marketplace and need to add Tanzania based payment gateway to add payments from customer and send payment to vendors after deducting admin commission. I can see there are by default 4 payment gateway listed: Paypal masspay, Paypal payout, Stripe connect and Direct bank transfer. Can you suggest me how to achieve it?

    • #102107
      Fantastic Kuhu

      Hi @Espen,

      Thank you for reaching out to us.

      All the transactions is managed by WooCommerce. By default WooCommerce supports Bank Payment, Cheque Payment, COD, Credit card and PayPal. You may refer the knowledbase link for the general details .

      In case you want to integrate any country specific WooCommerce Payment Gateway, that can be done via customization as it needs to be made compatible at vendor end as well.

      After going through the above link, please do let us know in case you want to get any specific information.


    • #102135
      Espen Kvelland

      I have gone through this document:
      And trying to add “RazorPay” option in WCMP. I have installed “RazorPay” woo-commerce plugin and added key-id, and key-secret into woo-commerce settings, but still I am not able to see form fields in Vendors tab. I am attaching here the screenshot. please have a look in it and let me know your feedback, what I am missing here?

    • #102600

      Hi, there was a missing code, which will display the form-field under razorpay tab. I have updated the doc.
      Here is the coding snippet for you :

      add_action( 'settings_page_payment_razorpay_tab_init', function ($tab, $subsection ){
              new WCMp_Settings_Payment_Razor_Pay( $tab, $subsection );
          }, 10, 2);
      class WCMp_Settings_Payment_Razor_Pay {
           * Holds the values to be used in the fields callbacks
          private $options;
          private $tab;
          private $subsection;
          private $razorpay_key_id;
          private $razorpay_key_secret;
           * Start up
         public function __construct($tab, $subsection) {
              $this->tab = $tab;
              $this->subsection = $subsection;
              $this->options = get_option("wcmp_{$this->tab}_{$this->subsection}_settings_name");
              $razorpay_details = get_option('woocommerce_razorpay_settings');
              if (isset($razorpay_details['testmode']) && !empty($razorpay_details['testmode'])) {
                  $this->razorpay_key_id = $razorpay_details['testmode'];
              if (isset($razorpay_details['key_id']) && !empty($razorpay_details['key_id'])) {
                  $this->razorpay_key_id = $razorpay_details['key_id'];
              if (isset($razorpay_details['key_secret']) && !empty($razorpay_details['key_secret'])) {
                  $this->razorpay_key_secret = $razorpay_details['key_secret'];
           * Register and add settings
          public function settings_page_init() {
              global $WCMp;
              $settings_tab_options = array("tab" => "{$this->tab}",
                  "ref" => &$this,
                  "subsection" => "{$this->subsection}",
                  "sections" => array(
                      "api_settings_section" => array("title" => __('API keys', 'dc-woocommerce-multi-vendor'), // Section one
                          "fields" => array(
                              "key_id" => array('title' => __('Key Id', 'dc-woocommerce-multi-vendor'), 'type' => 'password', 'id' => 'key_id', 'label_for' => 'key_id', 'name' => 'key_id', 'hints' => __('Key id, you will get this credential from razorpay account apikeys.', 'dc-woocommerce-multi-vendor')), // Text
                              "key_secret" => array('title' => __('Key Secret', 'dc-woocommerce-multi-vendor'), 'type' => 'password', 'id' => 'key_secret', 'label_for' => 'key_secret', 'name' => 'key_secret', 'hints' => __('Key Secret, you will get this credential from razorpay account apikeys.', 'dc-woocommerce-multi-vendor')), // Text
              $WCMp->admin->settings->settings_field_withsubtab_init(apply_filters("settings_{$this->tab}_{$this->subsection}_tab_options", $settings_tab_options));
           * Sanitize each setting field as needed
           * @param array $input Contains all settings fields as array keys
          public function wcmp_payment_razorpay_settings_sanitize_old($input) {
          $new_input = array();
              $hasError = false;
                  $new_input['key_id'] = sanitize_text_field($input['key_id']);
                  $new_input['key_secret'] = sanitize_text_field($input['key_secret']);
              if (!$hasError) {
                          "wcmp_{$this->tab}_{$this->subsection}_settings_name", esc_attr("wcmp_{$this->tab}_{$this->subsection}_settings_admin_updated"), __('Razorpay Gateway Settings Updated', 'dc-woocommerce-multi-vendor'), 'updated'
              return apply_filters("settings_{$this->tab}_{$this->subsection}_tab_new_input", $new_input, $input);
    • #110059

      As I can see the issue is fixed. So we are closing the ticket now. In case any issue arises kindly raise a new ticket.

Viewing 4 reply threads

The topic ‘Custom Payment Gateway’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price