How it works
Accepting payments is as simple as two steps: securely collect details with the JS SDK on the client, then finalize the payment from your server.
Securely Collect Payment Details
Use the Pro-Life Payments JS SDK to capture and tokenize payment details safely on the client side.
Finalize Payment (server-side)
Use the Pro-Life Payments API to process the payment securely from your server with the tokenized payment details.
Securely Collect Payment Details
The Pro-Life Payments JS SDK embeds a payment form into your page to securely collect payment details from your customer. When the details are collected, Pro-Life Payments tokenizes all the sensitive information and creates a PaymentToken.
Generate Payment Tokens
Use the code sample below to learn how to create a PaymentToken
Finalize Payment (server-side)
Once the PaymentToken is created, the last step is to complete the payment by creating a PaymentRequest from your server.
Use the Pro-Life Payments Create a Payment API to create a PaymentRequest with the PaymentToken created in your UI, the currency, and an amount.
If the API request is successful you'll receive a PaymentRequest object with all the payment details. If it isn't, you'll receive an Error response indicating why the transaction was not processed.
curl --request POST \
--url https://api-dev.prolifepayments.com/payments/v1/payment-requests \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'secretKey: sk_your_secret_key' \
--data '
{
"amount": 100,
"currency": "usd",
"paymentToken": "pt_your_payment_token"
}
'Your integration is complete
You've finished both steps for accepting online payments — securely collecting details and finalizing the charge.
Your application is now ready to start processing transactions.
Next Steps
Continue your integration journey with these helpful resources.
Did this page help you?
Your feedback helps us improve our documentation.
Last updated 2 months ago