diffInDays($date->copy()->addMinutes($paymentAttemptLimit)); $hours = $date->diffInHours($date->copy()->addMinutes($paymentAttemptLimit)->subDays($days)) ; $minutes = $date->diffInMinutes($date->copy()->addMinutes($paymentAttemptLimit)->subDays($days)->subHours($hours)); $receive_date = $currencyConversionObject ? Carbon::now()->endOfDay()->addWeekdays($currencyConversionObject->getServiceId() === 3 ? 3 : 1)->timezone('Asia/Singapore')->format('4:00 \P\M, jS M, Y \G\M\T T') : null; return [ 'bank' => new BankResource(Bank::find($calculationObject->getConfigurations()->getBankId())), 'rate' => $calculationObject->getConfigurations()->getRate(), 'local_total' => $calculationObject->getLocalTotal(), 'foreign_total' => $calculationObject->getForeignTotal(), 'conversion_amount' => $calculationObject->getConversionTotal(), 'service_charge' => $calculationObject->getServiceCharge(), 'tax_total' => $calculationObject->getTax(), 'tax' => $calculationObject->getConfigurations()->getTax(), 'sub_total' => $calculationObject->getSubTotal(), 'total' => $calculationObject->getTotal(), 'date' => Carbon::now()->timezone('Asia/Singapore')->format('h:i a, jS M, Y \G\M\T T'), 'receive_date' => $receive_date, 'payment_attempt_limit' => CarbonInterval::days($days)->hours($hours)->minutes($minutes)->forHumans(), 'voucher_discount_amount' => $calculationObject->getVoucherDiscountAmount(), 'voucher_code' => $calculationObject->getVoucherCode(), ]; } }