Skip to content

Commit

Permalink
lang_path not working in laravel 7
Browse files Browse the repository at this point in the history
  • Loading branch information
NafezlyDotCom committed Dec 2, 2022
1 parent e1469b2 commit 11cb4e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/Classes/PaymobPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,22 @@ public function getErrorMessage($code){
else
return __('nafezly::messages.An_error_occurred_while_executing_the_operation');
}

public function refund($transaction_id,$amount): array
{
$request_new_token = Http::withHeaders(['content-type' => 'application/json'])
->post('https://accept.paymobsolutions.com/api/auth/tokens', [
"api_key" => $this->paymob_api_key
])->json();
$refund_process = Http::withHeaders(['content-type' => 'application/json'])
->post('https://accept.paymob.com/api/acceptance/void_refund/refund',['auth_token'=>$request_new_token['token'],'transaction_id'=>$transaction_id,'amount_cents'=>$amount])->json();

dd($refund_process);
return [
'transaction_id'=>$transaction_id,
'amount'=>$amount,
];

}

}
4 changes: 2 additions & 2 deletions src/NafezlyPaymentsServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function boot()
__DIR__ . '/../config/nafezly-payments.php' => config_path('nafezly-payments.php'),
]);
$this->publishes([
__DIR__ . '/../resources/lang' => lang_path('vendor/payments'),
__DIR__ . '/../resources/lang' => app()->getLocale('vendor/payments'),
]);
}

Expand Down Expand Up @@ -105,7 +105,7 @@ protected function registerPublishing()
__DIR__ . '/../config/nafezly-payments.php' => config_path('nafezly-payments.php'),
], 'nafezly-payments-config');
$this->publishes([
__DIR__ . '/../resources/lang' => lang_path('vendor/payments'),
__DIR__ . '/../resources/lang' => app()->getLocale('vendor/payments'),
], 'nafezly-payments-lang');
$this->publishes([
__DIR__ . '/../resources/views' => resource_path('views/vendor/payments'),
Expand Down

0 comments on commit 11cb4e7

Please sign in to comment.