Hi, I have installed the package but can't figure out how to trigger a job. Do I have to manually dispatch the job or is it automatically done? I've commented the last line, I don't manage to figure this out.
public function store(Request $request)
{
Validator::make($request->all(), [
'amount' => ['required', 'integer'], // NEED TO FIX THIS
]);
$account = Account::findOrFail($request['account']['id']);
$amount = (int)$request['amount'];
$account->deposits()->create([
'amount' => $amount,
'user_id' => $request['user']['id'],
]);
$transaction['order_id'] = uniqid(); // invoice number
$transaction['amountTotal'] = (FLOAT) $amount;
$transaction['note'] = 'Transaction note';
$transaction['buyer_name'] = auth()->user()->full_name;
$transaction['buyer_email'] = auth()->user()->email;
$transaction['redirect_url'] = url('/admin/deposits'); // When Transaction was comleted
$transaction['cancel_url'] = url('/admin/deposits'); // When user click cancel link
/*
* @required true
* @example first item
*/
$transaction['items'][] = [
'itemDescription' => 'Deposit',
'itemPrice' => (FLOAT) $amount, // USD
'itemQty' => (INT) 1,
'itemSubtotalAmount' => (FLOAT) $amount // USD
];
$transaction['payload'] = [
'foo' => [
'bar' => 'baz'
]
];
$link = CoinPayment::generatelink($transaction);
//$test = CoinpaymentListener::dispatch($transaction);
return Inertia::location($link);
}
Hi, I have installed the package but can't figure out how to trigger a job. Do I have to manually dispatch the job or is it automatically done? I've commented the last line, I don't manage to figure this out.