Fills the gaps between the admin panel screens and the backend: a full free-text + slide-count + language -> AI-generated presentation flow with new slide-cloning logic in TemplateFillService, a "my presentations" list endpoint, a swappable payment-gateway structure for wallet top-ups (fake driver for now), and avatar upload / public-profile toggle / account deletion / password change / notification preference endpoints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Services\Payments;
|
|
|
|
use App\Contracts\PaymentGateway;
|
|
use App\Models\WalletDeposit;
|
|
use Illuminate\Support\Str;
|
|
|
|
/**
|
|
* Stand-in gateway used until a real provider (e.g. ZarinPal, Zibal) is wired up.
|
|
* It simulates an instant-success redirect straight to the callback route, so the
|
|
* full initiate -> redirect -> callback -> credit flow is testable end-to-end
|
|
* without any external credentials. Swap the PaymentGateway binding in
|
|
* AppServiceProvider to replace it with a real driver.
|
|
*/
|
|
class FakePaymentGateway implements PaymentGateway
|
|
{
|
|
public function initiate(WalletDeposit $deposit): string
|
|
{
|
|
$deposit->update(['reference_id' => (string) Str::uuid()]);
|
|
|
|
return route('api.wallet.deposits.callback', [
|
|
'deposit' => $deposit->id,
|
|
'reference_id' => $deposit->reference_id,
|
|
'status' => 'success',
|
|
]);
|
|
}
|
|
|
|
public function verify(WalletDeposit $deposit, array $callbackPayload): bool
|
|
{
|
|
return $deposit->reference_id !== null
|
|
&& ($callbackPayload['reference_id'] ?? null) === $deposit->reference_id
|
|
&& ($callbackPayload['status'] ?? null) === 'success';
|
|
}
|
|
}
|