How to connect WooCommerce with Nummuspay

First of all you have to edit you functions.php file in your theme folder, usually located here: \htdocs\wp-content\themes\storefront\functions.php
Add the following code snipped at the end of the functions.php file and save the file:
	add_action( 'woocommerce_thankyou', 'nummuspay_checkout', 20 );
if (!function_exists( 'nummuspay_checkout' )) {
    function nummuspay_checkout($order_id) {
        if ($order_id > 0) {
            $order = wc_get_order($order_id);
            if ($order instanceof WC_Order) {
                <script>$ = jQuery.noConflict(true);</script>
                <script src=""></script>
                <script type="text/javascript">
                    var orderData = <?php echo json_encode($order->get_data()) ?>;
                        merchantUniqueID: orderData.number,
                        publicCheckoutPageID: YOUR_CHECKOUT_PAGE_ID_FROM_NUMMUSPAY,
                        currency: orderData.currency,
                        tax: 0,
                        firstName: orderData.billing.first_name,
                        lastName: orderData.billing.last_name,
                        billingAddress1: orderData.billing.address_1,
                        billingAddress2: orderData.billing.address_2,
                        billingState: orderData.billing.state,
                        billingZip: orderData.billing.postcode
The next step will be to go to: WooCommerce > Settings > Payments in order to install a payment method. From this screen enable Check Payments and click on Set up button.

Through this screen you will be able to confiqure your settings: 
  • Enable/Disable – Enable to use. Disable to turn off.
  • Title – Choose the title shown to customers during checkout
  • Description –Add info shown to customers if they choose Check
  • Instructions – Explain how to pay by Check

Please make the proper amendments and save changes.

The next step is to navigate to WooCommerce > Settings > Advanced > REST API > Click "Add key button" in order to create an api key. Choose Read/Write on permissions options and click on "Generate API key"

From this screen you will automatically obtain your credentials:

The next step is to navigate to Nummuspay > Settings > Plugin Settings in order to activate WooCommerce. You have to enter your Woocommerce api credentials and your site url, as well:

Still need help? Contact Us Contact Us