PaySG and Plumber guide

This guides includes instructions on how to create your own Plumber pipe to automatically create payments from FormSG inputs.

Demo

  • For payment link generation: go.gov.sg/paysg-plumber-demo.

    • Once the form is submitted, a payment email will be sent to the subject's email.

  • For payment link and fine letter generation: go.gov.sg/paysg-fine-demo.

    • Once the form is submitted, an email with a PDF fine that includes a PaySG QR code will be sent to the subject's email.

Creating components to use in Plumber

You will need:

  1. A form and its corresponding secret key.

  2. A payment service and an API key, issued to you by the PaySG team (team@pay.gov.sg)

Form creation

  1. Create a form on FormSG and save your secret key. You’ll need this to view responses and to link the form to Plumber. A template can be found here.

  2. Some fields that you should include in your form as these will be used to create your payment link later on. These fields have been included in the template.

    1. Reference ID (if not required for your use case, you can manually input a value like '-' on Plumber later on)

    2. Payer’s name

    3. Payer’s email

    4. Payer’s address (if not required for your use case, you can manually input a value like '-' on Plumber later on)

    5. Payer’s identifier (could be NRIC or any other identifier of your choice)

    6. Payment amount (Note: If the payment amount is in dollars, you will need to include Plumber's Calculator action to convert this into cents to pass in to PaySG.)

Payment service creation

  1. Create a payment service on PaySG’s staging environment: staging.pay.gov.sg. Ensure that you test out the workflow/pipe on our staging environment before moving to our production environment at pay.gov.sg.

  2. During the creation of the payment service, you’ll need to select a payment method. For Stripe, please create an account at https://dashboard.stripe.com/register. Creating a Stripe account is free. Ensure that the Stripe account is set to test mode.

  3. Contact us at team@pay.gov.sg to get an API key for your payment service. You will need this to connect the payment service to Plumber.

Connecting FormSG and PaySG on Plumber

Create a pipe at plumber.gov.sg. Note that collaborators cannot be added to the pipe. Should you require shared access to the pipe, we recommend that you create a group email and use it to access and create pipes on Plumber.

Setting up FormSG as a trigger.

Follow Plumber's guide to set up your form as a trigger. Once complete, move to the next step to complete PaySG as an action.

Setting up Calculator as an action

PaySG requires the payment amount to be passed in in cents. If your Form payment amount is in dollars, you'll need to include the Calculator action to convert the value to cents before passing it into PaySG.

Setting up PaySG as an action

Follow Plumber's guide to connect PaySG.

  • Once you've connected PaySG, proceed to set up the action.

  • Select the input accordingly. You can choose to manually input fields or select from the form response.

(Optional) Set up LetterSG as an action

(Optional)Set up PaySG's Send Payment Email as an action

Choose the "Send Payment Email" event to send out PaySG's payment email to payers once the payment link has been created.

If you would like to send the payment link in your own customise email, refer to Plumber's guide on sending an email via Postman.

Last updated