Set up payment updates
Payments have a lifecycle. Primer has simplified learning payments and standardized the payment lifecycle for all processors. This way, you only need to rationalize about payments once.
You can learn more about Primer’s payment lifecycle here.

Primer's payment lifecycle
As the payment is processed and goes through its lifecycle, you can get updates on the payment’s state in two ways:
Universal Checkout events
Update your frontend UI with callbacks via the Primer SDK.
Payment webhooks
Receive payment notification events directly to your server.
Universal Checkout events
The Primer SDK has various event callbacks you can listen to. These callbacks include onCheckoutComplete()
and onPaymentMethodAction()
. These are useful for updating the UI of your application, for example, to show loading indicators, success screens or failure screens.
However, as these are client-side, it’s not the best practice to rely on these callbacks as the single source of truth. For this, it’s recommended to rely on payment webhooks.
Payment webhooks
Primer can also send webhook notification events to your server. These should be used to update the status of the payment on your server. See more details about the expected webhook payloads in our API reference.
Handle the Payment’s Lifecycle
All Primer payments conform to a unified payment lifecycle. Each payment will progress through some combination of the payment statuses on their way through your workflow.