Route SMS voice uploads through Transfer with wallet billing.
Deploy Ladill Transfer / deploy (push) Successful in 28s
Deploy Ladill Transfer / deploy (push) Successful in 28s
Add a service API for the Ladill SMS platform to store voice recordings in Transfer and charge monthly storage from the customer wallet. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Models\QrCode;
|
||||
use App\Models\Transfer;
|
||||
use App\Models\TransferFile;
|
||||
use RuntimeException;
|
||||
|
||||
class DirectTransferFileUrl
|
||||
{
|
||||
public static function for(Transfer $transfer, TransferFile $file): string
|
||||
{
|
||||
$shortCode = $transfer->qrCode?->short_code;
|
||||
if ($shortCode === null || $shortCode === '') {
|
||||
throw new RuntimeException('Transfer file URL is unavailable.');
|
||||
}
|
||||
|
||||
return QrCode::publicBaseUrl().'/q/'.$shortCode.'/transfer/files/'.$file->id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user