• Home
  • Demo
  • Buy Now
RISE - Ultimate Project Manager & CRM
    RISE - Ultimate Project Manager & CRMInstallation & MaintenancePersonalizationSettingsClient ManagementAI AssistantInvoices & PaymentsProjects & TasksTeam & CollaborationProductivity ToolsSales & ServicesRISE ReportsPluginsFAQChange logs
Mailbox PluginLanding Page Builder PluginEasy Backup PluginSquare Payment Method PluginLogin as Client PluginAsset Management Plugin2 Factor Authentication PluginPassword Manager PluginSocial Login PluginGoogle Meet Integration PluginSpreadsheets PluginZoom Integration PluginAuto Attendance PluginWhiteboards PluginDocs PluginBlog Manager PluginWhatsApp Link PluginMicrosoft Teams Integration PluginProperty Management PluginTelegram Notification PluginAWS S3 Integration PluginWhatsApp Notification PluginWasabi Integration PluginBackblaze Integration PluginCloudflare R2 Integration PluginDigitalOcean Spaces Integration PluginAdyen Payment Method PluginbKash Payment Method Pluginiyzico Payment Method PluginJazzCash Payment Method PluginMercado Pago Payment Method PluginMidtrans Payment Method PluginMontonio Payment Method PluginN-Genius Payment Method PluginNagad Payment Method PluginPayFast Payment Method PluginPaysera Payment Method PluginPaystack Payment Method PluginPix Payment Method PluginRazorpay Payment Method PluginRocket Payment Method PluginSSLCommerz Payment Method Plugin
  1. Docs
  2. RISE - Ultimate Project Manager & CRM
  3. Plugins

Take online payments from a plugin

Your plugin can take online payments for things that are not invoices, for example a payslip, a donation or a booking. It works with every payment method that has a gateway: Stripe, PayPal, Paytm or a gateway added by a plugin.

Step 1: Register a payment context

Call this from your plugin's index.php file:

register_payment_context("my_plugin_payslip", array(
    "on_success" => function ($payment, $transaction) {
        // mark payslip $payment["context_id"] as paid with $transaction["amount"] and $transaction["transaction_id"]
        return "my_plugin/payslips/view/" . $payment["context_id"]; // optional page to open after payment
    },
    "can_pay" => function ($payment) {
        return true; // optional, return false or an error message to stop the payment
    }
));
  • on_success runs once for each payment, after the provider confirms it and the amount and currency match.
  • can_pay is optional. It runs before the payment starts.

Step 2: Start the payment

In your controller, first check that the user can pay for this record. Then start the payment:

$Payment_processor = new \App\Libraries\Payment_processor($this);
$result = $Payment_processor->create_online_payment(array(
    "context" => "my_plugin_payslip",
    "context_id" => $payslip_id,
    "amount" => $amount,          // from your database, never from the request
    "currency" => "USD",
    "payment_method_id" => $payment_method_id,
    "title" => "Payslip #" . $payslip_id,
    "redirect_to" => "my_plugin/payslips/view/" . $payslip_id,
    "data" => array()             // anything on_success needs later
));

The result has:

  • success and checkout_url: send the buyer to this URL.
  • success and checkout_form: post this form.
  • success false and message: the payment can't start. Show the message.
Was this article helpful? Yes No
How can we improve this article?
© 2026 Fairsketch
Home Get Support Buy Now

Delete?

Are you sure? You won't be able to undo this action!
To do