Skip to content

Inline card payments

FinDock inline card payments is in a closed pilot. If you would like to participate, please contact FinDock Support.

FinDock inline card payments is a new feature enabled card payment collection without redirects to PSP hosted payment pages.

Inline card payments require some additional configuration. Existing redirect channels do not automatically change behavior when the inline card payments feature is enabled.

Prerequisites

  • FinDock installed and configured
  • ProcessingHub connected
  • WebHub connected
  • Stripe extension installed and configured

Limitations

Stripe configuration

The Stripe payment extension for Stipe needs to have the card payment method activated if it is not already. No other actions are required from the FinDock setup viewpoint. The FinDock integration with Stripe already handles the additional requirements for inline payments.

FinDock also automatically handles 3D Secure (3DS) authentication by redirecting the payer to the challenge from Stripe. However, the authentication behavior is dependent on the fraud detection settings of your Stripe merchant account. Your FinDock setup does not control payer authentication.

3DS with Payment Experiences

If you are using 3DS with FinDock Payment Experiences components, you must add the Stripe webhook URL, https://hooks.stripe.com, to the Content Security Policy (CSP) in Salesforce as one of your Trusted URLs.

Payment Experiences

When inline card payments is enabled for your org, you get news settings for each instance of the Pay Button component. The Stripe card payment method gets a new Payment Mode setting with inline-specific configuration options for payer authentication methods.

Once configured, the Pay Button component renders an inline form for entering card details instead of redirecting to an external hosted payment page.

Handling success and failure redirects

In every payment experience, you need to think about where the payer should land after a successful payment, and what do if the payment fails (on the last step, when clicking the Pay button).

With inline payments, you have a couple of option for handling what happens after the payer clicks the Pay Button. In the hosted payment page (HPP) scenario, the payer is already outside your payment experience and is redirected from the HPP back to what is typically a absolute URL based on the status of the payment action.

With inline payments, you have can:

  • Set static custom pages for success and failures by entering an absolute URL in the Pay Button configuration. This approach is used, for example, by FinDock Flow templates.
  • Embed succuss and failure content within a single Flow Screen by setting the success URL to #success (without quotes) and the failure URL to #failure. This prevents the payer from being redirected, and allows allow you to capture the event as input for another custom action. This works both in a pro-code LWC solution, as well as input to navigate to a next step in a Flow.

For the second option, the event to listen for is paymentPending. The event is set to false when the Pay Button action is finished. The event is broadcast over:

  • Flow Attribute Change Event: capture as output of the Pay Button in Flow.
  • LWC Custom Event: Any container LWC holding the Pay Button component is informed
  • Lightning message channel: any loaded LWC (even outside the hierarchy) can register for this event and handle it according to your implementation

Payment API

Custom integrations with the Payment API need to generate the Stripe card token through 3rd party services before initiating the payment. FinDock handles token generation automatically when payments are initiated through Payment Experiences components.

New payment method parameters

The GET /PaymentMethods endpoint returns additional, new parameters for the CreditCard payment method with PaymentHub-Stripe as processor. The new parameters are all optional and returned alongside parameters for redirects to the Stripe hosted payment page, such as locale, itemName and description.

Parameter TypeUsage
processorTokenIdStringToken Id required for Stripe inline card payments, for example pm_1Q2w3E4r5T6y.
setupFutureUsageBooleanIndicates if token can be used (stored) for future payments or is single use only (and not stored); required if token Id is provided for one-time payments. |
processorCustomerIdStringId that ties the token to the given payer at Stripe. For example: cus_1Q2w3E4r5T6y.

Using inline payment parameters

To initiate an inline card payment, add the token parameters to the PaymentMethod.Parameters block of your post to the /PaymentIntent endpoint. Please carefully note the interdependencies between parameters and how the impact the payment flow.

  • Without processorTokenId, the payment intent works as before. The payer is redirected to the Stripe hosted payment page, and Parameters only carries optional parameters for that page, like description.
  • With processorTokenId, the payer is charged with the token and is not redirected to the hosted payment page. Without processorCustomerId, the payer is treated as a new customer at Stripe.
  • With processorTokenId and processorCustomerId, the token is charged on that Stripe customer. FinDock does not check that the token and customer belong together, but Stripe rejects the payment if they are not linked.

The following payment intent example is a one-time card payment with a token for an existing Stripe customer, where the token is not stored for future payments.

{
    "SuccessURL": "https://www.example.com/success",
    "FailureURL": "https://www.example.com/error",
    "Payer": {
        "Contact": {
            "SalesforceFields": {
                "FirstName": "Test",
                "LastName": "Payer",
                "Email": "testpayer@example.com"
            }
        }
    },
    "OneTime": {
        "Amount": "36"
    },
    "PaymentMethod": {
        "Name": "CreditCard",
        "Processor": "PaymentHub-Stripe",
        "Parameters": {
            "processorTokenId": "pm_1Q2w3E4r5T6y",
            "setupFutureUsage": false,
            "processorCustomerId": "cus_1Q2w3E4r5T6y"
        }
    },
    "Settings": {
        "SourceConnector": "PaymentHub"
    }
}

For a new recurring card payment with a token for an existing Stripe customer, setupFutureUsage is not required as it is already implied through the Recurring block in the payment intent, as shown here.

{
    "SuccessURL": "https://www.example.com/success",
    "FailureURL": "https://www.example.com/error",
    "Payer": {
        "Contact": {
            "SalesforceFields": {
                "FirstName": "Test",
                "LastName": "Payer",
                "Email": "testpayer@example.com"
            }
        }
    },
    "Recurring": {
        "Amount": "25",
        "Frequency": "Monthly",
        "StartDate": "2027-01-01"
    },
    "PaymentMethod": {
        "Name": "CreditCard",
        "Processor": "PaymentHub-Stripe",
        "Parameters": {
            "processorTokenId": "pm_1Q2w3E4r5T6y",
            "processorCustomerId": "cus_1Q2w3E4r5T6y"
        }
    },
    "Settings": {
        "SourceConnector": "PaymentHub"
    }
}