---
schema_version: "1"
id: aa7427b3f64ae9458d495f85820b3707985d0e3491a54c0c0226e35504032417
title: Set Up a Flow to Send Payment Requests in Messaging Sessions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/messaging_components_payment_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_components_payment_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b28c0b5624617c81fb6182ea89bf100c8450ab4edf0c28b3fc673282107a62ca
description: Create Apex classes and a screen flow that service reps can run to send payment messaging components to customers in messaging sessions. The flow executes the Apex classes and passes the transaction details into the payment messaging component.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Set Up a Flow to Send Payment Requests in Messaging Sessions

Create Apex classes and a screen flow that service reps can run to send payment messaging components to customers in messaging sessions. The flow executes the Apex classes and passes the transaction details into the payment messaging component. 

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" colspan="2" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.messaging_editions.htm&amp;type=5&amp;language=en_US" target="_blank">View supported editions.</a></td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <a name="messaging_components_payment_flow__d354e1177"><!-- --></a><span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" id="messaging_components_payment_flow__d354e1177" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/resources-global/_corporate/images/checkmark.png" alt="Checkmark"></span>
              <strong>This article applies to:</strong>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Enhanced Apple Messages for Business channels</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/resources-global/_corporate/images/crossmark.png" alt="X icon"></span>
              <strong>This article doesn’t apply to:</strong>
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Enhanced In-App Chat, Enhanced Web Chat v1, Enhanced Web Chat v2, Enhanced
              WhatsApp, Enhanced Facebook Messenger, Standard and Enhanced SMS, Enhanced LINE, and
              Bring Your Own Channel</td>

          </tr>
        </tbody>
      </table> <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d102383e98">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d102383e98 ">To open, edit, or create a flow in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d102383e98 ">Manage Flow</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d102383e98 ">To create or edit a console app:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d102383e98 ">
              <p>Customize Application </p>
              <p style="margin-bottom:0;">AND View Setup and Configuration </p>
            </td>

          </tr>
        </tbody>
      </table>

1. Go to the **Apex Classes** page in Setup.
2. Create a series of Apex classes that determine the content of payment requests using your own product information. For reference documentation, see [RichMessaging Namespace](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_RichMessaging.htm).
3. In Flow Builder, create a screen flow that service reps can run to send a payment messaging component to customers in messaging sessions.
4. Add the flow to the Messaging Session page layout so service reps can run it during messaging sessions. See [Add Messaging to the Service Console](https://help.salesforce.com/s/articleView?id=service.livemessage_create_console_app.htm&release=264.0.0&type=5 "Configure the Service Console to put all messaging tools at your team's fingertips. Add Omni-Channel, customize the Messaging Session page layout, and make the Send Message global action available. Optionally, customize the Enhanced Conversation component and add messaging components to the Service Console.").
5. Send the component in enhanced Apple Messages for Business channels.
    1. During an active messaging session, in the Service Console, find the Flow component that’s linked to the question with options.
    2. Run the flow that’s linked to your payment component. The admin configures the flow’s steps, start button label, and location, so it may look different from our example.
        
        ![FLow component showing a messaging component](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/messaging_payment_6.png)
    3. Insert the message and finish the flow.
        
        A placeholder appears below the message field. No preview of the component is available.
    4. Click **Send** in the message field. The component is sent to the customer and appears in the conversation transcript.
        
        ![Conversation transcript showing a payment component](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/messaging_payment_7.png)
    5. If a message indicates that the payment was not successful, service reps can try again by resending the payment component. Payment requests expire after 5 minutes.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/images/icon_example.png)

Example

In this example flow, after a starting screen prompts the service rep to click **Next**, three Apex actions execute the payment line items, shipping methods, and payment totals Apex classes. A final screen inserts the payment messaging component into the message body to be sent by the rep.

![Sample flow](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/support_channels/images/messaging/messaging_payment_5.png)