Laybuy
Laybuy is a credit payment provider that allows customers to spread the cost of their order value over multiple payments.
This article describes how to setup and enable the Aurora Laybuy integration.
Introduction
Laybuy is a credit payment provider that allows customers to spread the cost of their order value over multiple payments. Aurora's integration with Laybuy allows your customers to make use of Laybuy's payment plans when placing orders via the Aurora Front-end.
The Laybuy payment solution does not currently offer deferred payment capture and as such all Laybuy payment transactions are essentially instance payments and must be manually refunded where an order cannot be fulfilled.
Initial Setup
The Laybuy Integration uses the Aurora Microservice (MS) framework, and as such must be set-up in advance by Aurora Commerce before you can use it with your store.
Doing this requires a one-off development to setup and configure your store to use the Laybuy MS, after which, you can then configure the integration at your own leisure.
If you have not yet had (or do not know if you have had) the Laybuy MS setup and configured for your store, then please contact Aurora Commerce for more details regarding how to get this done.
In order to configure your Laybuy MS, you will need to request the following details from Laybuy:
- Laybuy API endpoint prefix
- Laybuy Merchant ID
- Laybuy API key
Please request these details for both Staging (Test) and Production (Live) environments, so that you can test your integration before go live.
Aurora Backend Settings
Once the Laybuy MS has been setup and enabled for your store, you can follow these steps to allow your customers to use it on your front-end checkout.
Enable the Laybuy Microservice
Store > Settings > Feeds > Microservice > Proxy-laybuy
Configure visibility of the Laybuy payment option (in conjunction with the "Payment Types Accepted at Checkout" setting):
Parameter Name | Value For Integration | Note |
---|---|---|
Enabled? | checked | Controls whether the Laybuy payment option is visible on your checkout page: checked = accessible and visible unchecked = not accessible and not visible |
This 'visibility behaviour' is enforced entirely within the Aurora Front-end Templates and so is the default behaviour offered by the Aurora Demo Example Front-end Templates, but may not be how your own Front-end Templates are configured.
If you run into issues with payment option visibility, please check your Front-end Templates for the appropriate logic.
Payment Types Accepted at Checkout
Store > Settings > Payment Providers
Configure Aurora to accept orders using the Laybuy payment type:
Parameter Name | Value For Integration | Note |
---|---|---|
Validate Payment Type | checked | Controls whether the checkout enforces a strict/reduced list of payment types that are accepted on checkout submission. checked = payment types are enforced to the defined list unchecked = payment types are not enforced to the defined list |
Laybuy | checked | Controls whether Laybuy is on the list of payment types that will be accepted on checkout submission. checked = Laybuy is accepted and visible on checkout submission unchecked = Laybuy is not accepted and not visible on checkout submission |
This 'visibility behaviour' is enforced entirely within the Aurora Front-end Templates and so is the default behaviour offered by the Aurora Demo Example Front-end Templates, but may not be how your own Front-end Templates are configured.
If you run into issues with payment option visibility, please check your Front-end Templates for the appropriate logic.
Microservice Settings
Store > Microservice > Proxy Laybuy
Configure the Laybuy MS to communicate with the Laybuy API:
Parameter Name | Value for Integration | Notes |
---|---|---|
Is Live | Checked - for Live Unchecked - for Test | Whether the account uses the live or test credentials saved. |
Live Endpoint Prefix | https://api.laybuy.com | Unique prefix for the endpoint used by the Laybuy MS to contact the Laybuy API. This is provided by Laybuy during the account creation process. |
Live Merchant Account ID | Example value (do not use): 123456 | Merchant Account ID to be used with the Live API endpoint. |
Live API Key | Example value (do not use): AQEphmfuXNWTK0Qc+iSRh3Y3teW4R 4ZACIFJXUVCV0MjUrgpBR20FW5ZAa IQwV1bDb7kfNy1WIxIIkxgBw==-Er LKmM7hzDfeJPBKLLtniCu+V3JvIHv jsrkHxjufjtc=-KfLC5q6UaIPK38mH | API Key to be used with the Live API endpoint. |
Test API Endpoint Prefix | https://sandbox-api.laybuy.com/ | Unique prefix for the endpoint used by the Laybuy MS to contact the Laybuy staging API. This is provided by Laybuy during the account creation process. |
Test Merchant Account ID | Example value (do not use): 654321 | Merchant Account ID to be used with the Test API endpoint. |
Test API Key | Example value (do not use): AQEphmfuXNWTK0Qc+iSRh3Y3teW4R 4ZACIFJXUVCV0MjUrgpBR20FW5ZAa IQwV1bDb7kfNy1WIxIIkxgBw==-Er LKmM7hzDfeJPBKLLtniCu+V3JvIHv jsrkHxjufjtc=-KfLC5q6UaIPK38mH | API Key to be used with the Test API endpoint. |
Aurora Service Errors
Content > Site Text
User error messages from the Aurora payment service that can be changed and translated using the Aurora Site Text system:
Page | Part | Note |
---|---|---|
Checkout | CheckoutPayment proxy-laybuy Error: MSRequestInvalid | A general error when a request to the payment service cannot be provided. This maybe resolvable if the user tries the operation again. |
Checkout | CheckoutPayment proxy-laybuy Error: MSResponseInvalid | A general error when a response from the payment service cannot be provided. This maybe resolvable if the user tries the operation again. |
Checkout | CheckoutPayment proxy-laybuy Error: MSConfigurationError | The Laybuy MS has not been configured correctly and is unable to connect to the Laybuy API. |
Checkout | CheckoutPayment proxy-laybuy Error: MSPaymentProviderError | The Laybuy API has responded with an unknown error. More details on these errors can be found within: Store > Logs > API Integration Log |
Checkout | CheckoutPayment proxy-laybuy Error: MSPaymentProviderConnectionError | The Aurora Laybuy service was unable to connect to the Laybuy API. More details on these errors can be found within: Store > Logs > API Integration Log |
Checkout | CheckoutPayment proxy-laybuy Error: MSPaymentCancelled | The customer cancelled payment within Laybuy and was returned to checkout. |
Checkout | CheckoutPayment proxy-laybuy Error: MSPaymentDeclined | The customers payment request was declined by Laybuy and was returned to checkout. |
Checkout | CheckoutPayment proxy-laybuy Error: MSRefundFailed | The admin users refund request was unsuccessful. In this case a failed refund transaction will appear on the view order page with further details of why the request failed. |
Frontend Template Integration
In order to use the Laybuy MS within your checkout, you must simply include the following values within your checkout submission:
Name | Value |
---|---|
payment_type | proxy-laybuy |
payment_custom_fields[proxy-laybuy] | true |
Example template:
{if $config.microservice_proxylaybuy_live}
<p>
<input name="payment_custom_fields[proxy-laybuy]" value="true" type="hidden" />
<input type="radio" class="radio" name="payment_type" id="proxy-laybuy" value="proxy-laybuy" />
<label class="checkout_label_radio" for="proxy-laybuy">{site_text page="Checkout" part="Label: Laybuy"}</label>
</p>
{/if}
Testing
Please see the following documentation from Laybuy on testing: https://integrations.laybuy.com/reference#how-to-test
Updated over 2 years ago