public function process_payment($form, $request, $params)
 {
     if (isset($request->req['rm_payment_method'])) {
         $payment_method = $request->req['rm_payment_method'];
     } else {
         $payment_gateways = $this->get_setting('payment_gateway');
         if (!$payment_gateways || count($payment_gateways) == 0) {
             return;
         }
         if (!is_array($payment_gateways)) {
             $payment_gateways = array($payment_gateways);
         }
         $payment_method = $payment_gateways[0];
     }
     // Paypal handling
     if ($payment_method === "paypal") {
         $paypal_service = new RM_Paypal_Service();
         $pricing_details = $form->get_pricing_detail($request->req);
         $data = new stdClass();
         $data->form_id = $form->get_form_id();
         $data->submission_id = $params['sub_detail']->submission_id;
         if ($form->get_form_type() === RM_REG_FORM) {
             $data->user_id = $form->get_registered_user_id();
         }
         return $paypal_service->charge($data, $pricing_details);
     }
     if ($payment_method === "stripe") {
         $stripe_service = new RM_Stripe_Service();
         $pricing_details = $form->get_pricing_detail($request->req);
         $data = new stdClass();
         if (isset($request->req['stripeToken']) && !empty($request->req['stripeToken'])) {
             $data->stripeToken = $request->req['stripeToken'];
             $data->form_id = $form->get_form_id();
             $data->submission_id = $params['sub_detail']->submission_id;
             return $stripe_service->charge($data, $pricing_details);
         }
     }
 }