Skip to content

Commit

Permalink
Merchant Transaction Id Added
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipesh79 committed Oct 25, 2023
1 parent b91172a commit 644c277
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea
11 changes: 6 additions & 5 deletions src/LaravelPhonePe.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ class LaravelPhonePe
private $baseUrl;
private $saltKey;
private $saltIndex;
private $callBackUrl;

private $redirectUrl, $callBackUrl;
private $merchantTransactionId;

public function __construct()
{
Expand All @@ -21,18 +22,18 @@ public function __construct()
$this->baseUrl = config('phonepe.env') == 'production' ? 'https://api.phonepe.com/apis/hermes' : 'https://api-preprod.phonepe.com/apis/pg-sandbox';
$this->saltKey = config('phonepe.saltKey');
$this->saltIndex = config('phonepe.saltIndex');
$this->redirectUrl = config('phonepe.redirectUrl');
$this->callBackUrl = config('phonepe.callBackUrl');
$this->merchantTransactionId = config('phonepe.merchantTransactionId');
}

public function makePayment($amount, $merchantTransactionId, $phone)
public function makePayment($amount, $phone,$redirectUrl)
{
$data = array(
'merchantId' => $this->merchantId,
'merchantTransactionId' => $merchantTransactionId,
'merchantTransactionId' => $this->merchantTransactionId,
'merchantUserId' => $this->merchantUserId,
'amount' => $amount * 100,
'redirectUrl' => $this->redirectUrl,
'redirectUrl' => $redirectUrl,
'redirectMode' => 'POST',
'callbackUrl' => $this->callBackUrl,
'mobileNumber' => $phone,
Expand Down
1 change: 1 addition & 0 deletions src/config/phonepe.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
'saltIndex' => env('PHONEPE_SALT_INDEX'),
'redirectUrl' => env('PHONEPE_REDIRECT_URL'),
'callBackUrl' => env('PHONEPE_CALLBACK_URL'),
'merchantTransactionId' => env('PHONEPE_MERCHANT_TRANSACTION_ID'),
);

0 comments on commit 644c277

Please sign in to comment.