---
schema_version: "1"
id: 75aa6f5685afefa2856bfea48b1fa60e0729a9bf4948d5a28345567db4896ee8
title: Create and 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.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.messaging_components_payment.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bb17826a7c882b0687f32e65c2294c53754f7e1f4d1285e75606e21ecd16ce91
description: Request payments from customers during messaging sessions with a payment messaging component. Service reps can send the component to prompt the customer to make a payment with Apple Pay.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Create and Send Payment Requests in Messaging Sessions

Request payments from customers during messaging sessions with a payment messaging component. Service reps can send the component to prompt the customer to make a payment with Apple Pay. 

### 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__d292e1177"><!-- --></a><span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" id="messaging_components_payment__d292e1177" 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 permission">
        <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="d98778e98">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d98778e98 ">To create messaging components:</td>

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

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d98778e98 ">To send and receive messages in Messaging:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d98778e98 ">Messaging Agent</td>

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

1. Configure your Apple Pay settings and Messaging channel settings, and create a payment processing Apex class. For steps, see [Add Apple Pay to a Messaging Channel](https://help.salesforce.com/s/articleView?id=service.messaging_apple_pay_setup.htm&release=264.0.0&type=5 "To allow service reps to request payments during messaging sessions, add Apple Pay to your enhanced Apple Messages for Business channel.").
2. In Setup, go to the Messaging Components page.
3. Click **New Component.**
4. Click **Payment**, and then click **Next**.
5. Select the ProcessPaymentHandler Apex class that you created, and enter a prompt. Provide a URL that is sent if the component must be sent in plain text format, and select or upload an image that appears with the payment request.
    
    ![Design your payment request window](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_1.png)
    
    The prompt, plain text URL, and image are all saved as constants behind the scenes. You can reference those constants when you customize your component’s behavior and appearance in the Messaging Component Builder.
6. Edit the plain text version of your component to add text to accompany the URL you entered. The URL is represented on this screen as `{!$Constants.Url}`.
    
    ![Plain text window](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_2.png)
    
    The plain text format is used if the component is sent in a Messaging channel that’s not an enhanced Apple Messages for Business channel, or if the preferred format isn’t available.
7. Click **Next** and add a name and description for your component.
8. Click **Done**. The Messaging Component Builder opens.
    
    ![Messaging Component Builder with a payment messaging component open](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_3.png)
9. Add a format to customize how the component looks in messaging sessions. Click **Add Format**, select **Payment**, and then click **Done**.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_channels-264-0-0-production-enus/f3c4b3d2-ff86-4f7c-9fe2-3d8b23d35109/images/icon_note.png)
    
    Note Each messaging component is available in one or more formats, such as Payment, and some formats work only in certain channels. For a list of formats that each channel supports, see [Messaging Component Types and Formats](https://help.salesforce.com/s/articleView?id=service.messaging_component_formats.htm&release=264.0.0&type=5 "With messaging components, you can send structured content such as questions with options in enhanced Messaging channels and Enhanced Chat. Learn the purpose, format, and setup process of each component type."). It’s a good idea to add at least one supported format for each channel where the component will be sent. If no formats are added, the component uses the default text format.
10. In the left-hand sidebar, click the Payment format type to update its properties.
    
    ![Messaging Component Builder with Payment format highlighted](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_4.png)
    
    1. To use the prompt and image you provided earlier, in the Prompt Configuration and Image Configuration sections, select **Constant** and select the only available constant.
    2. For currency, provide your three-letter ISO 4217 currency code for the currency used in your payment requests.
    3. For Merchant Domain, provide the domain that you saved when verifying your merchant domain while adding Apple Pay to your channel.
11. After you update the remaining format properties, click **Save**.
12. Your component is saved in a draft state. When you're ready to make it available to your support team, click **Activate** at the top of the page.
    
    If you ever need to take the component offline—for example, to give you time to reconfigure it—open it in the Messaging Component Builder and click **Deactivate**. When you're ready, activate it again.

Next, create Apex classes and a flow that service reps can run to send the payment component to customers.

When you create a payment component, three standard parameters are also created. You can [reference](https://help.salesforce.com/s/articleView?id=service.messaging_components_sobject_formulas.htm&release=264.0.0&type=5 "Use sObject formulas to control the way that your messaging components appear in any non-Text format.") these parameters in flows, Apex, or the component properties.

- PaymentLineItems: The items for purchase that are listed in the payment request. When a payment request is sent, an Apex class populates the list of items.
- PaymentTotal: The total listed on the payment request. When a payment request is sent, an Apex class calculates the total.
- ShippingMethods: The shipping methods that you support. When a payment request is sent, an Apex class populates the shipping method information.

To view the parameters, open your messaging component in the Messaging Component Builder and click **Parameters** in the left-hand sidebar.

- **[Set Up a Flow to Send Payment Requests in Messaging Sessions](https://help.salesforce.com/s/articleView?id=service.messaging_components_payment_flow.htm&release=264.0.0&type=5)**  
    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.