Make getting paid faster and easier than ever! paymennt APIs provide an easy way to let your customers pay for their orders easily and securely.
- When a customer is ready to pay for their order/service, ٌYour system sends a Create payment link checkout API call to paymennt API with the order details.
- In the request you can either provide customer phone/email within the billing address and set the
sendEmailrequest parameters to
trueso that paymennt will send the payment link to the customer contact phone/email or you can get the payment redirect link from the response and share it with your customer.
- In your backend system, you can either listen to Google Firestort notifications for the document related to the checkout ( see the response from the Create payment link checkout API call), for more details on how to listen to Firebase messages in your system see Get realtime updates with Cloud Firestore. Alternatively you can register to receive checkout updates via Webhooks, see Webhooks API.
- Once your system is notified of a payment update, you should call the Get Checkout API call to retrieve the status.
- Based on the status of payment retrieved from the Get Checkout API call, you should update your order status on your system and provide the service to your customer if payment was complete.
That's it! You're ready to start testing.
Test the Integration
- Create a new payment link.
- Open the link in your internet browser.
- Once the payment page shows, Enter the following card details:
4242 4242 4242 4242
- Expiry date:
- Accept the Terms & Conditions and click Pay. You will be redirected to the order confirmation page. If you entered a real email address in the billing details, you'll also receive a payment confirmation email.
- Check the status of the payment on your system.
A checkout can have multiple statuses that describe the current state that the checkout is in.
|PENDING||New Checkout. User has not completed the payment.|
|AUTHORIZED||The payment has been authorized, a subsequent Capture or Cancel payment API call is expected before the checkout Expires.|
|PAID||This status is effective when a customer has successfully completed the payment associated with this checkout.|
|FAILED||Payment failed due to payment failure. paymennt failed to recover such a checkout process.|
|CANCELLED||User cancelled the checkout process and returned to the merchant page.|
|EXPIRED||Checkout has expired without being processed|
|REFUNDED||Checkout has been fully refunded to the Shopper|
|PARTIALLY_REFUNDED||Checkout have been partially refunded to the shopper|