Skip to content

Commit

Permalink
Merchant Transaction Id Error Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipesh79 committed Dec 5, 2023
1 parent 38ac830 commit 399ad08
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PHONEPE_ENV="staging" //staging or production
PHONEPE_SALT_KEY="099eb0cd-02cf-4e2a-8aca-3e6c6aff0399"
PHONEPE_SALT_INDEX="1"
PHONEPE_CALLBACK_URL="http://localhost:8000"
PHONEPE_MERCHANT_TRANSACTION_ID="MT7850590068188104"
```

### Publish Vendor File
Expand All @@ -40,7 +39,8 @@ use Dipesh79\LaravelPhonePe\LaravelPhonePe;
public function phonePePayment()
{
$phonepe = new LaravelPhonePe();
$url = $phonepe->makePayment(1000, '9999999999', 'https://locahost:8000/redirct-url');
//amount, phone number, callback url, unique merchant transaction id
$url = $phonepe->makePayment(1000, '9999999999', 'https://locahost:8000/redirct-url','1');
return redirect()->away($url);
}
Expand Down
7 changes: 2 additions & 5 deletions src/LaravelPhonePe.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class LaravelPhonePe
private $saltIndex;
private $callBackUrl;

private $merchantTransactionId;

public function __construct()
{
$this->merchantId = config('phonepe.merchantId');
Expand All @@ -23,14 +21,13 @@ public function __construct()
$this->saltKey = config('phonepe.saltKey');
$this->saltIndex = config('phonepe.saltIndex');
$this->callBackUrl = config('phonepe.callBackUrl');
$this->merchantTransactionId = config('phonepe.merchantTransactionId');
}

public function makePayment($amount, $phone,$redirectUrl)
public function makePayment($amount, $phone,$redirectUrl,$merchantTransactionId)
{
$data = array(
'merchantId' => $this->merchantId,
'merchantTransactionId' => $this->merchantTransactionId,
'merchantTransactionId' => $merchantTransactionId,
'merchantUserId' => $this->merchantUserId,
'amount' => $amount * 100,
'redirectUrl' => $redirectUrl,
Expand Down
3 changes: 1 addition & 2 deletions src/config/phonepe.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
'saltKey' => env('PHONEPE_SALT_KEY'),
'saltIndex' => env('PHONEPE_SALT_INDEX'),
'redirectUrl' => env('PHONEPE_REDIRECT_URL'),
'callBackUrl' => env('PHONEPE_CALLBACK_URL'),
'merchantTransactionId' => env('PHONEPE_MERCHANT_TRANSACTION_ID'),
'callBackUrl' => env('PHONEPE_CALLBACK_URL')
);

0 comments on commit 399ad08

Please sign in to comment.