¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -13,19 +13,17 @@ class Instamojo implements GatewayInterface
public $label;
public $description;
public function __construct()
{
$this->label = setting('instamojo_label');
$this->description = setting('instamojo_description');
}
public function client()
{
$endpoint = setting('instamojo_test_mode') ? 'https://test.instamojo.com/api/1.1/' : null;
return new \Instamojo\Instamojo(setting('instamojo_api_key'), setting('instamojo_auth_token'), $endpoint);
}
/**
* @throws Exception
*/
public function purchase(Order $order, Request $request)
{
if (currency() !== 'INR') {
@@ -51,13 +49,23 @@ class Instamojo implements GatewayInterface
return new InstamojoResponse($order, $response);
}
private function getRedirectUrl($order)
public function client()
{
return route('checkout.complete.store', ['orderId' => $order->id, 'paymentMethod' => 'instamojo']);
$endpoint = setting('instamojo_test_mode') ? 'https://test.instamojo.com/api/1.1/' : null;
return new \Instamojo\Instamojo(setting('instamojo_api_key'), setting('instamojo_auth_token'), $endpoint);
}
public function complete(Order $order)
{
return new InstamojoResponse($order, request()->all());
}
private function getRedirectUrl($order)
{
return route('checkout.complete.store', ['orderId' => $order->id, 'paymentMethod' => 'instamojo']);
}
}