> For the complete documentation index, see [llms.txt](https://re-source.gitbook.io/payments/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://re-source.gitbook.io/payments/components/stripe-payment-lwc.md).

# Stripe - Payment

The component allows to accept a Payment from a custom LWC component.&#x20;

It creates an incomplete Payment Intent using the provided amount (from the numeric attributte or from the record field) and captures a Payment Method. The allowed payment method types can be configured with the attribute, there is an option to provide a customer and show the existing payment methods.&#x20;

This component can be suitable for Experience Cloud page  in the custom LWC components to accept the payment for the Salesforce records.&#x20;

For example, the experienc cloud page can show the Event details, the Event record has an attendence Cost filed to be an Amount for the Payment. The component handles the Payment with Stripe.js and connected Stripe Dashboard, providing the events as well as able to store the Payment Intent Id and Success/Error status + details on the Salesforce record.

```html
<rs_pay-stripe-payment record-id="a06WU00000B8U10YAF"
                  currency="aud"
                  amount-field="Cost__c"
                  description-field="Description__c"
                  target-status-field="Payment_Status__c"
                  success-status-value="Paid"
                  error-status-value="Error"
                  error-message-target-field="Error_Message__c">
</rs_pay-stripe-payment>
```

<figure><img src="https://3102010779-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7icqDUNgsdQAb9yNX2az%2Fuploads%2FzuuAxIXGBNlGPDHWWk6S%2Fimage.png?alt=media&amp;token=e53017ae-71d8-4975-b3a6-5ace28d6abc6" alt=""><figcaption></figcaption></figure>

Please see the list of the attributes to configure the component:

| Attribute                               | Description                                                                             |
| --------------------------------------- | --------------------------------------------------------------------------------------- |
| Record Id                               | The record id to associate the payment with                                             |
| Stripe Customer Id                      | The Stripe Customer Id to associate the payment with                                    |
| Stripe Customer Id Field                | The API name of the field that contains the Stripe Customer Id                          |
| Allowed Payment Method Types            | Comma-separated list of allowed Stripe Payment Method Types                             |
| Allow Existing Payment Method Selection | Allow the user to select existing Payment Method (only if Stripe Customer is provided)  |
| Amount Field                            | The API name of the field that contains the amount to charge                            |
| Amount                                  | The amount to charge (used if no recordId and Amount Field are provided)                |
| Currency                                | The currency of the payment (defaults to Stripe Settings if not provided)               |
| Description Field                       | The API name of the field that contains the description of the payment                  |
| Description                             | The description of the payment (used if no recordId and Description Field are provided) |
| Payment Id Target Field                 | The API name of the field to store the Stripe Payment Intent Id                         |
| Target Status Field                     | The API name of the field to store the payment status                                   |
| Success Status Value                    | The value to set the Target Status Field to when the payment is successful              |
| Error Status Value                      | The value to set the Target Status Field to when the payment fails                      |
| Error Message Target Field              | The API name of the field to store the error message when the payment fails             |
| Success Message                         | The message to display when the payment is successful                                   |
| Uncaptured Message                      | The message to display when the payment is authorized and uncaptured                    |
| Allow Cancellation                      | Allow the user to cancel the payment                                                    |
| Cancel Message                          | The message to display when the payment is canceled                                     |
| Submit Button Label                     | The label of the submit button. Allows merging {amount}                                 |
