The Pre-Population API has been designed for merchants who obtain and store their customers information within their own CMS. When a customer would like to purchase with humm, the Merchant can easily populate data from their CMS into a humm Buyer Portal application automatically using this API.
How does it work?
The client's browser performs a post to humm's API. The POST endpoint returns a view. This view is essentially a UI to complete the final payment step (and resolve any validation errors from the posted data).
An approved, declined, error page may follow an authorisation. These pages do not redirect automatically. The page relies on the client to press the Redirect Now button. This action will redirect to the URLs you provided in the original POST.
private function postToCheckout($checkoutUrl, $payload)
{
echo
"<html>
<body>
<form id='form' action='$checkoutUrl' method='post'>";
foreach ($payload as $key => $value) {
echo "<input type='hidden' id='$key' name='$key' value='$value'/>";
}
echo
'</form>
</body>';
echo
'<script>
var form = document.getElementById("form");
form.submit();
</script>
</html>';
}
Testing
The merchant API has a test page for constructing a valid POST message at https://uat-seller.shophumm.com.au/TEST/API. Make sure each request has a unique (GUID) API reference. You may want to use a form auto-filler such as Chrome recorder as this is a very large form.
Note: If you require Sandbox Credentials for testing the API, please reach out to us via the Integration Assistance Form.