get
https://api.froogal.ai/loyalty//user/card-payment-history
Retrieves the payment history associated with loyalty cards for a user within a specific loyalty program. First, it extracts the IDs of loyalty cards associated with the loyalty program. It also checks if there's a request parameter to show all payments. Then, it retrieves loyalty card payments based on the user ID and loyalty card IDs. If not showing all payments, it filters out payments that are not successful. Next, it fetches the merchant details related to the loyalty program. Finally, it maps the retrieved payments, adjusting timestamps to the merchant's timezone, and returns the data as a success response containing payment details.
