From 4178d55145f1dff14623cab339b2de4d00ee85d1 Mon Sep 17 00:00:00 2001 From: Rodrigo Gonzalez Date: Mon, 20 Mar 2023 13:04:37 -0300 Subject: [PATCH] New payload uses an array for receipt info --- src/model/NotificationPayload.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/model/NotificationPayload.php b/src/model/NotificationPayload.php index 523982c..d95b0c4 100644 --- a/src/model/NotificationPayload.php +++ b/src/model/NotificationPayload.php @@ -80,7 +80,9 @@ class NotificationPayload $instance->latestReceipt = $request->input('unified_receipt.latest_receipt'); if ($request->has('unified_receipt.latest_receipt_info')) { - $instance->latestReceiptInfo = Receipt::createFromArray($request->input('unified_receipt.latest_receipt_info')); + if (count($request->input('unified_receipt.latest_receipt_info')) > 0) { + $instance->latestReceiptInfo = Receipt::createFromArray($request->input('unified_receipt.latest_receipt_info')[0]); + } } else { $instance->latestReceiptInfo = null; }