Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Classes/BinancePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
$binance_pay_key = $this->binance_api;
$binance_pay_secret = $this->binance_secret;
$signature = strtoupper(hash_hmac('SHA512',$payload,$binance_pay_secret));
$response = \Http::withHeaders([
$response = Http::withHeaders([
"Content-Type"=>"application/json",
"BinancePay-Timestamp"=>$timestamp,
"BinancePay-Nonce"=>$nonce,
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ChangellyPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u

//dd($key);

$response = \Http::withHeaders([
$response = Http::withHeaders([
"X-Api-Key" => $this->changelly_api_key,
'X-Signature'=> $key,
'Content-type'=>'application/json'
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/ClickPayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
else
$unique_id = $this->payment_id;

$response = \Http::withHeaders([
$response = Http::withHeaders([
'authorization' => $this->clickpay_server_key
])->post('https://secure.clickpay.com.sa/payment/request', [
"profile_id" => $this->clickpay_profile_id,
Expand Down Expand Up @@ -125,7 +125,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
public function verify(Request $request)
{

$response = \Http::withHeaders([
$response = Http::withHeaders([
'authorization' => $this->clickpay_server_key
])->post('https://secure.clickpay.com.sa/payment/query', [
'profile_id' => $this->clickpay_profile_id,
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/MamoPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
];

try{
$response = \Http::withToken($this->mamopayment_api_key)
$response = Http::withToken($this->mamopayment_api_key)
->post($this->mamopayment_base_url."/manage_api/v1/links",$payload);
if ($response->failed()) {
return [
Expand Down Expand Up @@ -111,7 +111,7 @@ public function verify(Request $request)
$payment_id = cache('mamo_payment_'.$request['payment_id']);

if(isset($payment_id)){
$response = \Http::withToken($this->mamopayment_api_key)
$response = Http::withToken($this->mamopayment_api_key)
->get($this->mamopayment_base_url."/manage_api/v1/links/".$payment_id);
if ($response->failed()) {
return [
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/NowPaymentsInvoicePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function verify(Request $request)
{
$invoice_id = $request->NP_id??$request->payment_id;

$response = \Http::withHeaders([
$response = Http::withHeaders([
'x-api-key'=>$this->nowpayments_api_key
])->get('https://api.nowpayments.io/v1/invoice/'.$invoice_id)->json();

Expand Down
4 changes: 2 additions & 2 deletions src/Classes/NowPaymentsPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
public function verify(Request $request)
{
$payment_id = $request->NP_id??$request->payment_id;
$response = \Http::withHeaders([
$response = Http::withHeaders([
'x-api-key'=>$this->nowpayments_api_key
])->get('https://api.nowpayments.io/v1/payment/'.$payment_id)->json();

Expand All @@ -104,7 +104,7 @@ public function verify(Request $request)
}
public function get_minimum_amount($from,$to,$fiat_equivalent="usd"){
try{
$response = \Http::withHeaders(['x-api-key'=>$this->nowpayments_api_key])->get('https://api.nowpayments.io/v1/min-amount?currency_from='.$from.'&currency_to='.$to.'&fiat_equivalent='.$fiat_equivalent)->json();
$response = Http::withHeaders(['x-api-key'=>$this->nowpayments_api_key])->get('https://api.nowpayments.io/v1/min-amount?currency_from='.$from.'&currency_to='.$to.'&fiat_equivalent='.$fiat_equivalent)->json();
return $response['fiat_equivalent'];
}catch(\Exception $e){
return 10000000;
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/OneLatPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u


try{
$payment_methods = \Http::withHeaders([
$payment_methods = Http::withHeaders([
'x-api-key' => $this->onelat_key,
'x-api-secret' => $this->onelat_secret,
'Content-Type' => 'application/json',
Expand All @@ -51,7 +51,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
if(null !== collect($payment_methods['payment_methods'])->where('type','CARD')->where('currency','USD')->first() ){
$method = collect($payment_methods['payment_methods'])->where('type','CARD')->where('currency','USD')->first();

$response = \Http::withHeaders([
$response = Http::withHeaders([
'x-api-key' => $this->onelat_key,
'x-api-secret' => $this->onelat_secret,
'Content-Type' => 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/PayPalCreditPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
'countryCode'=>""
];
try{
$fetch_address = \Http::get('http://ip-api.com/json/'.$this->get_ip())->json();
$fetch_address = Http::get('http://ip-api.com/json/'.$this->get_ip())->json();
if(is_array($fetch_address))
$country = array_replace_recursive($country,$fetch_address);
}catch(\Exception $e){}
Expand Down Expand Up @@ -242,7 +242,7 @@ public function get_ip(){
else
$ipaddress = 'UNKNOWN';
if($ipaddress=="127.0.0.1"){
$ip = \Http::get('https://api.ipify.org/?format=json')->json();
$ip = Http::get('https://api.ipify.org/?format=json')->json();
return $ip['ip'];
}
return $ipaddress;
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/PaycecPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u

try{

$country = \Http::get('http://ip-api.com/json/'.$this->get_ip())->json();
$country = Http::get('http://ip-api.com/json/'.$this->get_ip())->json();
$params = [
'merchantName' => $this->paycec_merchant_username,
'merchantSecretKey' => $this->paycec_merchant_secret,
Expand Down Expand Up @@ -180,7 +180,7 @@ public function get_ip(){
else
$ipaddress = 'UNKNOWN';
if($ipaddress=="127.0.0.1"){
$ip = \Http::get('https://api.ipify.org/?format=json')->json();
$ip = Http::get('https://api.ipify.org/?format=json')->json();
return $ip['ip'];
}
return $ipaddress;
Expand Down
8 changes: 4 additions & 4 deletions src/Classes/PaylinkPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
else
$payment_id = $this->payment_id;

$get_token_id = \Http::post($url."/api/auth",[
$get_token_id = Http::post($url."/api/auth",[
'apiId'=>$this->paylink_app_id,
'secretKey'=>$this->paylink_api_key,
'persistToken'=>false
])->json();
if(isset($get_token_id['id_token'])){
$response = \Http::withHeaders([
$response = Http::withHeaders([
'Authorization'=>"Bearer ".$get_token_id['id_token'],
'Content-Type'=>"application/JSON",
])->post($url."/api/addInvoice",[
Expand Down Expand Up @@ -104,13 +104,13 @@ public function verify(Request $request): array
$url = "https://restpilot.paylink.sa";

$payment_id = uniqid().rand(10000,99999);
$get_token_id = \Http::post($url."/api/auth",[
$get_token_id = Http::post($url."/api/auth",[
'apiId'=>$this->paylink_app_id,
'secretKey'=>$this->paylink_api_key,
'persistToken'=>false
])->json();
if(isset($get_token_id['id_token'])){
$response = \Http::withHeaders([
$response = Http::withHeaders([
'Authorization'=>"Bearer ".$get_token_id['id_token'],
'Content-Type'=>"application/json",
])->get($url."/api/getInvoice/".$request['transactionNo'])->json();
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/PaymobPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
else
$unique_id = $this->payment_id;

$res = \Http::withHeaders([
$res = Http::withHeaders([
'Authorization'=>"Token ".$this->paymob_secret_key,
])->post('https://accept.paymob.com/v1/intention/',[
'amount'=>$this->amount*100,
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/PayopPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
"failPath" => route($this->verify_route_name,['payment'=>"payop",'payment_id'=>$unique_id]),
];

$response = \Http::withHeaders([
$response = Http::withHeaders([
'Content-Type' => 'application/json',
])->post('https://api.payop.com/v1/invoices/create', $payload);
$json_response = $response->json();
Expand Down Expand Up @@ -130,7 +130,7 @@ public function verify(Request $request): array
}

if($invoice_id != ""){
$response = \Http::get('https://api.payop.com/v1/invoices/'.$invoice_id);
$response = Http::get('https://api.payop.com/v1/invoices/'.$invoice_id);
$response_json = $response->json();
if(isset($response_json['data']['status']) && in_array($response_json['data']['status'], ['success','paid'])){
return [
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/PrimePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
$secret1 = $this->prime_secret_word_1;
$data['sign'] =md5($secret1.$data['action'].$data['project'].$data['sum'].$data['currency'].$data['innerID'].$data['email'].$data['payWay']);

$response = \Http::asForm()->post('https://pay.primepayments.io/API/v2/',$data)->json();
$response = Http::asForm()->post('https://pay.primepayments.io/API/v2/',$data)->json();
dd($response);


Expand Down
6 changes: 3 additions & 3 deletions src/Classes/WisePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
if(is_array($this->source))
$selectedPaymentMethods_init=$this->source;

$init = \Http::withHeaders([
$init = Http::withHeaders([
'Cookie'=>"oauthToken=".$this->wise_api_key,
'Authorization'=>"Bearer ".$this->wise_api_key
])->get('https://wise.com/gateway/v3/profiles/'.$this->wise_profile_id.'/acquiring/payment-methods', [
Expand All @@ -67,7 +67,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
if(in_array($check_available_method,collect($init->json()['content'])->where('available',true)->pluck('paymentMethodType')->toArray()))
$available_payment_methods[]=$check_available_method;

$create_payment = \Http::withHeaders([
$create_payment = Http::withHeaders([
'Host' => 'wise.com',
'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0',
'Accept' => 'application/json, text/plain, */*',
Expand All @@ -94,7 +94,7 @@ public function pay($amount = null, $user_id = null, $user_first_name = null, $u
'selectedPaymentMethods' => $available_payment_methods,
]);
$create_payment_response = $create_payment->json();
$publish_payment_response = \Http::withHeaders([
$publish_payment_response = Http::withHeaders([
'Host' => 'wise.com',
'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64; rv:108.0) Gecko/20100101 Firefox/108.0',
'Accept' => 'application/json, text/plain, */*',
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/YallaPayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function verify(Request $request): array
}
}elseif(isset($request['trx_id'])){

$res = \Http::post('https://yallapay.net/api/transaction/verify',[
$res = Http::post('https://yallapay.net/api/transaction/verify',[
'private_key'=>$this->yallapay_secret_key,
'trx_id'=> $payment_id
]);
Expand Down