Flow Tutorial: Designing a Payment Collection Flow

This tutorial shows you how to design flows to enable secure credit card payment collection with CxEngage, powered by a third party. After completing this tutorial, you will: 

  • Have a basic understanding of how CxEngage can use third party integrations
  • Understand how reusable flows can be used within customer flows to provide repeatable robust experiences
  • Be able to design a flow that uses presents a script to agents that connects to a third party for secured payment collection

This feature can be configured as either: 

  1. A customer flow that has the resource portion built out to include agent scripting and a secure third party connection.
  2. A reusable flow that includes the agent script, a secure third party connection, and presents the payment collection script. The reusable flow is then invoked in the resource portion of a customer flow. This is the suggested method and the one used in this tutorial.

Prerequisites

  1. To fully configure a payment collection flow, configuration details are required that are only available for users with an account with a third party provider who provides this service, such as Eckoh. Contact your account representative for additional information.
  2. To complete the conference, you need to have a Twilio SIP domain that points to your CxEngage tenant. If your telephony service is provided by Lifesize, Inc. and you require assistance, please contact your CxEngage representative.
  3. You should be familiar with how to design a basic flow. This will be necessary to use this reusable flow and to effectively see how the predefined variables work. If you're not familiar with how to create a basic customer flow to the point of a queue interaction, you may want to start with the Design a Basic Interaction Flow Tutorial.
  4. The third party is accessed through an iFrame script component. We recommend that you have a basic understanding of creating and configuring agent scripts.
  5. If you are following along by building your own flows, this tutorial assumes that your tenant is populated with a queue to send interactions to as well as media prompts that you want presented to callers.

Part 1: Create a Reusable Payment Collection Script

The payment collection is presented as an agent script with an iFrame component. The secure connection is established with the Start and Stop Secure DTMF Collection notations. Include these components in a reusable flow that is then used as an object in your main interaction flow.

To create a payment collection script flow:

  1. Create a new flow, selecting Reusable as the type.
  2. Enter a name for the reusable payment collection flow. This appears as the flow notation's name in the flow designer. For example, "Collect Payment Script".
  3. Click Submit.
  4. Design the flow using the steps below as your guide.

Reusable flows have the option to turn any notation's parameter into variable input. Leave the Variable toggle disabled unless specified otherwise.

Your completed reusable flow will look something like this: 

Image of a completed payment collection script reusable flow

Step Details Element
Step 1

Drag and drop an Entry event into the Flow Designer window.

Step 2

Add a Script notation and connect the Entry event to it.

This script will ask the agent if they are ready to collect payment, and provide any required instructions or scripting.

Screen image of the Script flow notation
Step 3

Access the script editor. Bind the script to the resource name that will be used in your interaction flow, such as agent. Enter a variable name for the script that will be referenced later in this flow. For example, paymentprompt.

Configure the script with the following components.

  1. Dropdown: Use a dropdown component to ask the agent if they are ready to continue to payment collection.
    • Name: Enter a variable name for this component that will be referenced later in this flow. For example, paymentrequired.
    • Text: Type the question to present to the agent. For example, Are you ready to collect payment now?
    • Options: Create response options for yes and no.
  2. Text: Use the text component to provide instruction and scripting for a Yes selection.
    • Name: Enter a variable name for this component. For example, paymentyes.
    • Text: Enter any free form text that you want displayed to the agent. For example, Select Yes and click Finish to initiate a secure connection and begin the payment collection process. Advise the caller: "You will be temporarily removed from the conference while I set up the secured payment connection. This should only take a few seconds."
  3. Text: Use the text component to provide information for a No selection.
    • Name: Enter a variable name for this component. For example, paymentno.
    • Text: Enter the text that you want displayed to the agent. For example, If no payment is required, select No and click Finish to continue your conversation without payment collection."
Step 4

Next to the Script notation, add a Decision Branch and connect the Script notation to it.

This allows the flow to progress through different paths depending on the response to the dropdown question presented in Step 2. Next, we will design the different path options.

 

Screen image of a Decision Branch flow event.
Step 5

We'll start with the "Yes" path, which will be followed when an agent selects Yes from the drop down menu from Step 3.

Next to the Decision Branch, add a Start Secure DTMF Collection notation.

This notation triggers the third party connection by forwarding the customer to the third party and conferencing the customer with them and the agent. These calls are made to a SIP endpoint with interaction details including the interaction ID, an authentication token, and contact data to forward the call back and complete the conference.

  • Secure SIP Endpoint: Enter the SIP endpoint to dial for your third party account connection. Contact your account representative for details.
  • DTMF Suppressed SIP Endpoint: Enter the Twilio SIP endpoint for your tenant for the third party to conference the customer back to the agent. Contact your CxEngage representative for help in getting your Twilio SIP domain details.
  • Custom Headers: Optionally, enter additional custom headers to send to the third party. Keep in mind that the interaction ID is already included by default.
  • Outbound ANI: Enter the source for the call to the third party's SIP endpoint. For example, interaction/contact-point.
  • Dial Timeout (in seconds): The length of time to wait for the third party to pick up the call before being considered as unanswered. For example, the default value of 18 waits for 18 seconds after sending the dial command.
  • Record: If enabled, records the secure collection process. This value overrides any other flow recording settings during the secure collection process. This is enabled by default.
  • Prevent Agent Recording Control: If enabled, any agents involved in the conference will have their ability to pause or resume recording disabled during the secure collection process. This parameter is enabled by default. If disabled, agents will have the ability to pause or resume recording during the secure collection process if Recording Update Allowed is enabled in the flow default settings.
  • Conference When Finished: If enabled and the third party is disconnected for any reason, the customer will be forwarded back to the agent. This is enabled by default. If disabled and the third party is disconnected before the secure collection process is complete, the customer will not automatically be forwarded to the agent. We recommend leaving this parameter enabled unless you are handling this logic differently.
  • Beep On Entry: If enabled, a beep will sound when the customer and the third party are conferenced back with the agent, indicating that the agent is able to speak to the customer again. The beep will also sound after the secure collection process is complete, the third party is removed, and the customer is back with the agent. This is enabled by default.
  • Connected: Enter a binding variable name to assign the connection response. A successful connection will send a true response, while an unsuccessful one is false. For example, you can name the response success, and then later check for a successful connection with (= success true).
Image of the Start Secure DTMF Collection notation
Step 6

Next, we'll configure the flow to only proceed to the secure collection if the agent selected "Yes" to the script question from Step 3 asking if they need to collect payment. Any other responses will be handled with an upcoming step.

Connect the Decision Branch from Step 4 to the Start Secure DTMF Collection notation (Step 5). We'll design the flow to only proceed to the secure collection if the agent selected "Yes" to the script question from Step 3 asking if they were ready to collect payment. Any other responses will result in the script ending.

  • Label: Optionally, enter a label to appear on the connection in the Flow Designer, such as Payment = Yes.
  • Type: Conditional
  • Condition: Enter a condition statement that references the script response from the drop down question used in Step 3. If you've been using the names provided in these examples, your condition statement would be (= paymentprompt.elements.paymentrequired.value "yes").
Step 7

Next, we'll design the default flow path, for any response to the script question other than "Yes".

Below the Decision Branch, add an Exit event.

Screen image of the Exit flow event
Step 8

Connect the Decision Branch from Step 4 to the Exit event. We'll configure this connection path for anything other than a "Yes" response to the payment collection question from Step 3.

  • Label: Optionally, enter a label to appear on the connection in the Flow Designer, such as Payment = No.
  • Type: Default
  • Condition: N/A

Next, we'll assign some variables that will be used to display data to the agent during the payment collection.

Checkpoint: Your flow should look similar to this example.

Image of a design checkpoint for a payment collection script reusable flow

Step 9 Next to the Start Secure DTMF Collection notation, add another Decision Branch and connect the Start Secure DTMF Collection notation to it. This Decision Branch will be used to provide one path for a successful third party connection, and a path for any unsuccessful attempts. Screen image of a decision branch icon
Step 10

We'll assign a second variable that will be used to present the agent ID to the agent in the payment collection script. Next to the Decision Branch, add an Assign notation and connect them.

Design Tip: Add this notation slightly above the Decision Branch. Creating an arch will make it easier to connect branches later in this tutorial.

  • Name: Enter the name to assign to the agent ID value, such as agentId.
  • Value: Enter the value to present, agent.id.
Screen image of the Assign flow notation

Checkpoint: Your flow should look similar to this example.

Checkpoint image of a secure payment collection script reusable flow

Step 11

Next, we'll continue designing the path for successful connections. The third party uses the interaction ID to link the payment information appropriately. We'll assign a variable to provide the interaction ID to the agent during payment collection. Next to the Assign notation, add another Assign notation and connect them.

  • Name: Enter the name to assign to the interaction ID value, such as linkId.
  • Value: Enter the path to obtain the interaction ID, interaction/interaction-id.

Next, we'll create the payment collection script.

Screen image of the Assign flow notation
Step 12 Next to the Assign notation, add a Script notation and connect them. Image of the Script flow notation
Step 13

Access the script editor. Enter a variable name for the script that will be referenced later in this flow. For example, paymentprocess. Bind the script to the resource name that will be used in the resource portion of your interaction flow, such as agent.

Configure the script with the following components.

  1. Text: Use the text component to present the agent with their resource ID, using the variable assigned in Step 10. When displayed, the real time value for the variable will be displayed.
    • Name: Enter a variable name for this component. For example, agentidentifier.
    • Text: Enter the text that you want displayed to the agent, surrounding any variable names in braces. For example, Your agent ID is: {{agentId}}
  2. Text: Use another text component to provide present the interaction ID to the agent, using the variable assigned in Step 9.
    • Name: Enter a variable name for this component. For example, calllinkid.
    • Text: Enter the text that you want displayed to the agent, surrounding any variable names in braces. For example, Your call link ID is: {{linkId}}
  3. iFrame: Use the iFrame component to connect to Eckoh's payment collection system.
    • Name: Enter a variable name for this component. For example, pymtiframe.
    • HTML source address: Enter the URL to access the payment collection under your third party account. Contact your account representative for details.
    • Height (in pixels): Optionally, enter the number of pixels for the window's height, such as 500.
    • Width (in pixels): Optionally, enter the number of pixels for the window's width, such as 1000.
Step 14

Next to the Script notation, add the Stop Secure DTMF Collection notation and connect them.

This notation disconnects the third party connection and places the customer back into conference with the agent.

  • Beep on Entry: If enabled, a beep will sound when the customer is added back into conference with the agent after the third party has been disconnected. This is enabled by default.
  • Record: If enabled, records the interaction after the third party has been disconnected. This value overrides any other flow recording settings during the secure collection process. This is enabled by default.
Image of the Stop Secure DTMF Collection notation
Step 15

Next to the Stop Secure DTMF Collection notation, add an Exit event and connect them.

Design Tip: Add the Exit event slightly below the Stop Secure DTMF Collection notation, bringing it back in line with the Decision Branch or similar location. Creating this arch will make it easier to connect branches later in this tutorial.

Image of the Exit flow notation

Checkpoint: Your flow should look similar to this example.

Checkpoint image of the secure payment collection script reusable flow

Step 16

Steps 9 through 15 created a path for a successful Eckoh connection. Now we'll create a path for unsuccessful connections and configure both branch paths.

Click on the Decision Branch from Step 9. Create a second connection branch from the Decision Branch and connect it to the Exit event from Step 15.

Design Tip: If you created the previous connection branch with the suggested arch, this connection doesn't overlap with your current design. If your flow follows a straight path, you may have trouble locating this new connection path over the existing one. You can also click anywhere on a connection to drag out into angles, depending on your design preference.

 

 
Step 17

Configure both of the connection branches from Steps 10 and 16.

Branch from Step 10

  • Label: Optionally, enter a label to identify this path as the one for successful connections, such as Connected.
  • Type: Conditional
  • Condition: Enter a condition statement that checks for a "true" response to the binding variable assigned to the Connected field from the Start Secure DTMF Collection notation from Step 5. For example, (= success true)

Branch from Step 16

  • Label: Optionally, enter a label to identify this path as the one for unsuccessful connections, such as Connection Unsuccessful.
  • Type: Default
  • Condition: N/A
 

End Result: Your completed design should look similar to this example.

Completed image of the secured payment collection script reusable flow

Step 18

Publish the flow.

  • Enter a mandatory version name and click Submit to save the flow.
Image of the Publish button in Flow Designer

Part 2: Create a Customer Interaction Flow

The payment collection flow is a reusable flow that can now be inserted into any interaction flow. We'll create a customer interaction flow that invokes the reusable payment collection script.

To create a customer interaction flow: 

  1. Create a new flow, selecting Customer as the type.
  2. Enter a name for the flow. For example, "Call Flow with Payment Script".
  3. Click Submit.
  4. Design the flow using the steps below as your guide.
Step Details Element
Step 1

Drag and drop an Entry event into the Flow Designer window.

Step 2

Add a Queue with Media notation and connect the Entry event to it.

  • Queue: Select the queue that calls received on this flow are sent to.
  • Media: Select a media file to play to callers waiting in queue.
  • Callback Enabled: Leave disabled. For information on this feature, refer to the instructions to enable queue callbacks.
  • Resource: Enter the binding variable for the resource receiving calls on this queue. This should match the resource binding variable used in Part 1 of this tutorial, such as agent.
Image of the Queue with Media flow notation
Step 3

Add a Conference Customer In notation and connect Queue with Media to it.

  • Record: Optionally, click to enable to automatically record customer interactions.
    • Note that the recording settings in the Start Secure DTMF Collection notation override these settings. If this toggle is disabled but the secure collection recording is enabled, that process will be still be recorded.
  • Beep: Optionally, click to enable a beep to indicate when the customer is added to the conference.
    • If using this feature, it should be enabled on both the Conference Customer In and Conference Resource notations within your flow to ensure that the notification is provided regardless of which participant enters the conversation first.
  • Waiting Music: Optionally, select an audio file to play to callers while they are being conferenced with an agent, until they are connected and able to speak.
Image of the Conference Customer In flow notation
Step 4

Add the Disconnect notation and connect Conference Customer In to it.

  • Participant: Customer
Image of the Disconnect flow notation
Step 5 Add the Exit event and connect Disconnect to it. Image of the Exit flow notation

Checkpoint: Your flow should look similar to this example.

Image of the customer portion of an interaction flow

Step 6

Now we need to design the resource sub-flow. In an empty section of the canvas, add the Resource Entry event.

  • Signal Name: resource-acquired (default value)
  • Condition: Leave empty
  • Resource: Enter the binding variable for the resource receiving calls. This should match the resource binding variable used previously in this tutorial, such as agent.
Image of the Resource Entry event
Step 7

Add the Work Offer Flow notation and connect the Resource Entry to it.

  • Resource: Enter the binding variable for the resource receiving interactions on this queue. This should match the resource binding variable used in previous portions of this tutorial, such as agent.
  • Timeout: Enter the length of time that the work offer will be presented to the agent for acceptance before it is considered rejected. The default value is 30 seconds.
  • Disposition Codes: Select the Disposition List to use for calls on this flow. The list includes the lists available through the Disposition Lists menu.
  • Auto Answer: Click to enable to have WebRTC calls automatically accepted by the agent. If disabled, the agent must accept the work offer prior to handling the call.
  • Target Wrap Up Time (seconds): Enter the goal time, in seconds, for agents to complete their post call work. The default value is 30 seconds.
  • Max Wrap Up Time (seconds): Enter the maximum time frame, in seconds, for agents to complete their post call work in a wrap up state. The default value is 30 seconds.
  • Auto Wrap Up: Optionally, click to enable to have agents automatically placed in Wrap Up after ending a call.
  • Allow Wrap Up Update: Optionally, click to allow agents to manually turn automatic Wrap Up on or off.
  • Auto Screen-pop: Optionally, leave enabled to trigger your internal screen pop.
  • Outbound Caller ANI: Leave as the default Contact Point value.
Image of the Work Offer Flow notation
Step 8

Add a Parallel Branch and connect the Work Offer Flow to it.

This allows the flow to progress through multiple paths simultaneously. We'll design two branches to run in parallel; one to conference the resource into the conversation and another to run the reusable payment collection script created in Part 1 of this tutorial.

Image of the Parallel Branch flow event
Step 9

Next to the Parallel Branch, add a Conference Resource notation and connect them.

  • Resource: Enter the binding variable for the resource being conferenced. This should match the resource binding variable used previously in this flow, such as agent.
  • Muted: Optionally, click to enable and have the agent muted when first added to the conversation.
  • Beep: Optionally, click to enable a beep to indicate when the resource is added to the conference.
    • If using this feature, it should be enabled on both the Conference Customer In and Conference Resource notations within your flow to ensure that the notification is provided regardless of which participant enters the conversation first.
  • Waiting Media: Optionally, select an audio file to play to agents while they are being conferenced with a caller, until they are connected and able to speak.

 

Image of the Conference Resource flow notation
Step 10

In an other area next to the Parallel Branch, add the reusable flow that you created in Part 1 of this tutorial. It will be on your design palette as a flow notation under the Reusable heading. The name will be the name entered when you created the reusable flow. In this tutorial, we called it Collect Payment Script.

  • Version: *Use Active Version*

Connect the Parallel Branch from Step 8 to this reusable flow.

Image of the Collect Payment Script reusable flow
Step 11 Add another Parallel Branch and connect both Conference Resource and your reusable payment collection script flow to it. Image of a Parallel Branch

Checkpoint: Your flow should look similar to this example.

Image of the second checkpoint for designing a payment collection interaction flow

Step 12

Next to the Parallel Branch, add a Disconnect notation and connect them.

  • Participant: Select the resource binding variable that you entered for the Resource Entry event in Step 6.

Troubleshooting Tip! The Participant parameter defaults to a Customer value and needs to be changed here to disconnect the agent instead. If you don't see your agent option in the drop down list, confirm that you've entered a Resource value in your Resource Entry event.


Image of the Disconnect notation
Step 13

Next to the Disconnect, add a Free Resource notation and connect them.

  • Participant: agent
  • Set Presence: Ready
  • ReasonN/A
Image of the Free Resource flow notation
Step 14 Next to Free Resource, add an Exit event and connect them. Image of the Exit flow event

End Result: Your completed design should look similar to this example.

Image of the payment collection interaction flow

Step 15 Click the gear icon on the canvas to access the flow settings and select the Flow Defaults tab. Enter any default settings that you want for this flow. Image of the Flow Settings icon
Step 16

Publish the flow.

Enter a mandatory version name and click Submit to save the flow.

Image of the Publish icon in Flow Designer