This commit is contained in:
David Bomba 2024-09-16 09:32:39 +10:00
parent 2464556ef2
commit e3559c4a5f
2 changed files with 10 additions and 8 deletions

View File

@ -29,13 +29,8 @@ class Blockonomics implements MethodInterface
{
use MakesHash;
public $driver_class;
public $blockonomics;
public function __construct(BlockonomicsPaymentDriver $driver_class)
public function __construct(public BlockonomicsPaymentDriver $blockonomics)
{
$this->blockonomics = $driver_class;
$this->blockonomics->init();
}
public function authorizeView($data)
@ -45,12 +40,13 @@ class Blockonomics implements MethodInterface
public function authorizeRequest($request)
{
}
public function authorizeResponse($request)
{
}
public function getBTCAddress()
public function getBTCAddress(): string
{
$api_key = $this->blockonomics->api_key;
// TODO: remove ?reset=1 before marking PR as ready
@ -125,7 +121,8 @@ class Blockonomics implements MethodInterface
$this->blockonomics->client,
$this->blockonomics->client->company,
);
return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]);
return redirect()->route('client.payments.show', ['payment' => $payment->hashed_id]);
} catch (\Throwable $e) {
$blockonomics = $this->blockonomics;

View File

@ -100,11 +100,16 @@ class BlockonomicsPaymentDriver extends BaseDriver
public function processPaymentView(array $data)
{
$this->init();
return $this->payment_method->paymentView($data); //this is your custom implementation from here
}
public function processPaymentResponse($request)
{
$this->init();
return $this->payment_method->paymentResponse($request);
}