EagleEye AJAX Account Validation

Introduction

When integrating EagleEye into the frontend at some point you may want to validate a customer-provided card number or account. This implementation would be a common part of the checkout process and so we have a dedicated AJAX endpoint that will validate the account and save the account details in the customer's session for later use (preventing frequent API calls to EagleEye).

Endpoint: POST /ajax/Ajax_Frontend_EagleEye_DiscountCard/setMemberCard

📘

Validating Discount Card Holders with EagleEye

You may turn on and off the actual validation step where we call EagleEyes API to determine if a Discount Card Number or Email address is valid in the EagleEye Discount Card Settings. More detail is provided here

Request Parameters

VariableValuesRequiredDescription
discount_card_numberStringYes without email_addressThe EagleEye discount card number.
email_addressStringYes without discount_card_numberThe users email address which may be registered to an EagleEye wallet.

Response Parameters

VariableValueDescription
successBooleanWere we able to resolve an EagleEye wallet for the provided information?
messageStringContextual Information to be displayed to the user in the event of the validation failing.

These can be changed in Aurora SiteText*

Example Responses

Responses are in JSON and will match the following examples:

Successful

{ "success": true }

Unsuccessful - No account found

{ "success": false, "message": "No identity found" }

Unsuccessful - Service unavailable

{ "success": false, "message": "Service unavailable" }

Site Text

You may use Aurora Site Text to change the error messages using the following attributes:

Page: "Eagle Eye"

PartDescription
"No Identity Found"The provided details could not be resolved to an EagleEye wallet.
"Service Unavailable"There was an issue contacting the EagleEye API
"Validation Error"The data sent to Aurora via this endpoint did not pass validation. Please check that the data payload being sent is correct according to the Request Parameters at the top of this document.

🚧

There is no example implementation within the Aurora Demo templates.