How to Add Payment Link to Invoices?

You can add a payment link to your invoices. Your users can then click the said link to pay for the items on the invoice. 

Adding a Payment Link to Invoices

Simply use the following code snippet to add a payment link below the items on your invoices: 

<?php<br>	add_action(<br>		'getpaid_email_cart_totals_total',
		function( $invoice ) {
			/**@var WPInv_Invoice $invoice */
			if ( $invoice->needs_payment() ) {
				'<div style="margin-top: 10px;"><a href="%s">%s</a></div>',
				esc_url( $invoice->get_checkout_payment_url() ),
				__( 'Pay Securely Online' ) );
		} } );

We recommend using the Code Snippets plugin for adding snippets to your site. 

The above code snippet first checks if an invoice requires payment. If yes, it displays a payment link below the invoice total on the invoices list table. 

Still need help? Contact Us Contact Us