Invoice Payment Gateway

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

Once the user checks out, they will receive an email notifying them to expect an invoice.

B2BKing does not generate invoices itself - it is not an invoicing plugin. You can send invoices to customers manually. B2BKing is compatible with most invoicing plugins - click for a list of free, compatible invoice plugins. ( To send invoices to customers automatically, read further below. )

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

After you enable the payment gateway, make sure to also enable it by 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 that you want, such as:

The customer 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 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, 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 was used by the customer.

Order Status #

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