New payload uses an array for receipt info

This commit is contained in:
Rodrigo Gonzalez 2023-03-20 13:04:37 -03:00
parent 1b118cc2cf
commit 4178d55145

View File

@ -80,7 +80,9 @@ class NotificationPayload
$instance->latestReceipt = $request->input('unified_receipt.latest_receipt'); $instance->latestReceipt = $request->input('unified_receipt.latest_receipt');
if ($request->has('unified_receipt.latest_receipt_info')) { 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 { } else {
$instance->latestReceiptInfo = null; $instance->latestReceiptInfo = null;
} }