What is a Payment?
A Payment is a first-class object that unifies the representation of a user payment across all your processors or payment methods.
A Primer payment is made of:
- a payment status that conforms to a unified payment lifecycle
- payment method information such as card details
- order details such as line items and currency
- customer details such as contact information, shipping, and billing address
- a timeline of events created throughout the lifecycle of the payment
You may be familiar with the transaction concept used by many payment processors. Because a single Primer payment can go through multiple processors via fallbacks, retries or split routing, it can contain multiple transactions, all of which are clearly displayed on the payment's Timeline.
All Primer payments conform to a unified payment lifecycle, which makes them work the same way regardless of the payment services you need.
A payment always has a payment status. Each payment will progress through some combination of the statuses listed below on their way through your Workflow.
A newly-created payment is assigned the status .
The payment is awaiting a subsequent action or callback. This usually occurs with asynchronous processors. Prepare for this contingency by setting up Webhooks.
The processor has authorized the payment and no further status-altering actions have been defined in your Workflow.
The processor has settled funds in your account. If the entirety of the payment amount has been settled, the payment will have the status
Some processors allow for the capture of only a part of the authorized amount. If you leverage this capability, the payment status will be set to
The processor has declined the payment and no further status-altering actions have been defined in your Workflow. You may want to consider retrying certain declined payments.
This usually occurs when there is a processor gateway issue, such as a service disruption. Set up retries and fallbacks to mitigate failures.
The payment was canceled prior to it being settled.
The payment has been submitted for settlement and funds will be settled later. This usually occurs with asynchronous processors. Prepare for this contingency by setting up Webhooks.
A payment may go through multiple processors in the event of retries and fallbacks. Workflows streamline all processor responses to make sure you only see a single instance of each relevant payment status. Individual processor responses can be inspected in the Timeline.
Payments are created automatically by Universal Checkout - our unified client-side SDK - or manually by sending a request to the Payments API.
In both cases, the following data is required to create a payment:
- An order ID
- An amount (or a list of line items), and a currency code
- A payment method token
The Order ID offers a simple way for you to tie one or multiple payments to an order in your system.
You can reuse the same order ID for multiple payments. This is handy to link multiple payments together.
Line items and currency
They describe the total amount and the currency that will be sent to the processor to authorize and capture the payment.
Payment method token
A payment method token is a string representing sensitive payment method credentials and customer data.
Primer provides Universal Checkout, our all-in-one Checkout SDK, to securely capture payment method data while fully embedded on your site or in your app.
By communicating directly with Primer's PCI-L1 tokenization service, Universal Checkout transforms sensitive customer data into a secure uniform string called a payment method token.
Universal Checkout generates a payment method token regardless of the customer's chosen payment method. This enables you to reason about your checkout flow in a unified way.
Our agnostic tokenization service and centralized vault enable you to handle recurring payments, fallbacks, and retries across processors without compromising UX.
No more PSP-specific tokens — now you own your payment data.
Available for every payment in the Dashboard, the payment timeline is the best representation of a payment on Primer. It displays all attributes of the payment, as well as the entire series of events that have taken place throughout its lifecycle.
Navigate, search and filter your payments with an easy-to-use interface in the Payments section of the Primer Dashboard.
Select a payment to see its detailed timeline of events.
Primer is not a black box, but rather your payments infrastructure. Select a specific event to see the requests and responses, providing full transparency into everything that’s happened to your payment throughout its journey.