Checkout

important

When using Credova as a 'payment method', the order can only be triggered and placed after confirming that the application status of SIGNED was sent back to your system via Credova's callback notification OR by checking that the Application status is SIGNED via the status endpoint.

Either way it is important to check if the Application Id on the data package returned above was already used before in another confirmed order in your system. Case it is already being used then take the required steps to warn the customer or/and cancel the order.

Once the users are able to pre-qualify and see the available financing options, the next step is to add our financing platform as a payment option in your website.

The checkout process involves some backend and frontend work. It starts with a call to our API from your backend passing the user data and the products from the cart to create an application. If your request is successful, the API will return a publicId that you can use to open the checkout popup from within your website page while keeping the user on your site. Next, you can then get a confirmation response once the user completes the Credova process and the contract is SIGNED.

Open the checkout popup

To open the checkout popup you only have to call the checkout method passing the publicId returned by the API.

CRDV.plugin.checkout("the-public-id");

The popup will guide the user throughout the checkout process.

The checkout method returns a promise that you can use to check if the user completed the process or closed the popup.

CRDV.plugin.checkout("the-public-id").then(function(completed) {
if (completed) {
console.log("Checkout was completed");
} else {
console.log("Checkout was closed");
}
});

Example: Opening the popup

You can use this HTML code to test the checkout method. Just copy/paste this code in a file and save it on your computer.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CRDV</title>
</head>
<body>
<script src="https://plugin.credova.com/plugin.min.js"></script>
<script>
CRDV.plugin.config({ environment: CRDV.Environment.Sandbox, store: "ARV000" });
CRDV.plugin.checkout("the-public-id").then(function(completed) {
if (completed) {
console.log("Checkout was completed");
} else {
console.log("Checkout was closed");
}
});
</script>
</body>
</html>