LegalCollect · Pay Now Button

One click from
invoice to paid.

If you use the LegalCollect payment gateway, you can add a “Pay Now” button directly to the PDF invoices Actionstep generates. Take the pain out of getting paid — before an invoice is ever overdue.

Why put a button on the invoice?

Don't wait for “overdue” to offer an easy way to pay.

Setting it up

Actionstep has a feature called Calculated Merge Fields that lets you (or your implementation partner) create custom merge fields for documents and emails. Two calculated merge fields power the Pay Now button.

Before you start, you'll need:

An advanced feature. Calculated Merge Fields are typically only available to Actionstep users with Admin access. If you don't have experience with Actionstep's merge fields or document assembly, ask your Actionstep implementation partner — or us — for assistance.

Step 1 — the Balance Due merge field

The first field determines the current amount due on an invoice, formatted without a dollar sign or thousand separator — important, because the amount is used as a parameter in an API call and must not include special characters.

  1. Open the merge field list

    Log in to Actionstep, navigate to Admin > Document Assembly, then click Merge Field List.

  2. Add a calculated field

    Click Add Calculated Field (top right) and set the Merge Field Name to SP_BalanceDueInvoice.

  3. Paste the calculation code

    Copy the code below into the Calculation Code section, then click Save.

$A = (floatval(str_replace(array('$', ','), '', '[[SP_TotalInclusive]]')));
$B = (floatval(str_replace(array('$', ','), '', '[[SP_FeeDiscountAmount]]')));
$X = $A + $B;
$Y = (floatval(str_replace(array('$', ','), '', '[[SP_FeeDiscountAmount]]')));
$Z = (floatval(str_replace(array('$', ','), '', '[[SP_TrustTotalAppliedOnInvoiceCreatedDate]]')));
$calculation = $X - $Y - $Z;
echo '$' . number_format($calculation, 2);

Step 2 — the Pay Now link merge field

  1. Add a second calculated field

    Click Add Calculated Field again and set the Merge Field Name to LegalCollectPayNowLink.

  2. Paste the calculation code

    Copy the code below into the Calculation Code section, then click Save.

  3. Insert your gateway link

    Replace <<YOUR PAYMENT GATEWAY LINK GOES HERE>> with your payment gateway link from LegalCollect, found under Settings > Payment Gateway. It looks like https://actioncollect.app/paynow/ABCDEFGHI89=/ — the trailing string is your unique gateway key, so copy it exactly.

//Set the LegalCollect base URL from the Payment Gateway settings screen
$BaseURL = '<<YOUR PAYMENT GATEWAY LINK GOES HERE>>/';

//The invoice number of the ActionStep invoice
$INVNo = '[[SP_OurReference]]';

//Gets the amount of an invoice and removes the dollar sign and comma
$Amount = str_replace(["$",","], '', '[[SP_BalanceDueInvoice]]');

//Concatenates the variables to create the final URL
$LinkURL = $BaseURL . $INVNo . '/' . $Amount;

//Return the final URL
echo $LinkURL;

Step 3 — use the merge field in your templates

You can now use the new merge field in document and email templates — your invoice template being the most likely place. Insert the merge field for a plain link, or add an image for a proper “Pay Now” button:

  1. Download your template

    Navigate to Admin > Document Assembly and download your invoice template.

  2. Add your button

    Place your Pay Now button image where you want it on the invoice.

  3. Link it to the merge field

    Right-click the button and set the link to the merge field name — <<LegalCollectPayNowLink>> if you used the recommended name.

  4. Upload the template

    Upload the document back to Actionstep to update your template. Done — every invoice now carries a payment button.

Every firm's templates differ. If you're not sure how to proceed, we recommend getting advice from your Actionstep implementation partner — or just ask us.

More LegalCollect features

Get started

Put a button on it.

We can have the Pay Now button running on your invoices as part of onboarding — book a demo to see it in action.