Invoice Payment Gateway

How the Invoice Gateway Works #

The invoice payment gateway allows customers to checkout without immediate payment, by selecting the "invoice payment" option.

Once a customer checks out, they will receive an email notifying them to expect an invoice.

B2BKing does not generate invoices directly - it is not an invoicing solution. You can send invoices to customers manually, or by using a free invoicing plugin.

B2BKing is compatible with most invoicing plugins, but generally we recommend you use the free PDF Invoices & Packing Slips plugin. To send invoices to customers automatically using this plugin, read further below.

Enabling the invoice payment gateway is simple. You can do this in WooCommerce -> Settings -> Payments, by activating the "Invoice Payment" option.

The gateway can also be configured further by clicking on it, after which you will see the following settings panel:

Here you can control the title and description which customers see during checkout.

After you enable the payment gateway, make sure to also enable it for each group, in B2BKing -> Groups. This functionality allows you to control payment methods by group. For example you can enable invoice payments for B2B Users only, in a B2B + B2C Hybrid store.

Net 30, Net 60 terms #

The invoice payment gateway is editable, and you can show any text you want to your customers. For example, if you're using Net 30 terms, you could set it up as follows:

You could edit the invoice method, by going to WooCommerce -> Settings -> Payments and entering any text you'd like, such as:

Customers will then see it as follows during checkout:

Sending (Attaching) Invoices Automatically to Order Emails #

You may want to send an invoice automatically and immediately when the customer places an order via the B2BKing Invoice gateway.

To do this, you can use the following invoicing plugin (free version):

Then go to this plugin's settings and enable 'Attach to: Order on-hold':

Finally, you may want to add the following PHP code snippet to your site:

add_filter('wpo_wcpdf_document_is_allowed', function( $allowed, $document ) {
    if ( ! empty( $order = $document->order ) && $document->get_type() == 'invoice' ) {
        $payment_method_title = is_callable( array( $order,'get_payment_method' ) ) ? $order->get_payment_method() : '';
        if ( stripos( $payment_method_title, 'b2bking-invoice-gateway' ) === false ) {
            $allowed = false;
        }
    }
    return $allowed;
}, 10, 2 );

What this snippet does is that it makes sure the invoice is only attached when the invoice payment gateway is used by the customer.

Order Status: On Hold / Processing #

By default, the invoice gateway sets orders to the "On Hold" status. If you'd like to change this, you can do so by adding a PHP code snippet to the site.

For example, to change this to the "Processing" status, add the following:

add_filter('b2bking_invoice_payment_order_status', function($status, $order){
	return 'processing';
}, 10, 2);

Powered by BetterDocs