Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNe0x1 committed Jan 25, 2024
1 parent 49d9039 commit be3d089
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions includes/class-depay-wc-payments-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function get_accept( $order ) {
)
);
}
if ( wp_remote_retrieve_response_code( $usd_amount ) === 429 ) {
if ( 429 === wp_remote_retrieve_response_code( $usd_amount ) ) {
DePay_WC_Payments::log( 'To many requests! Please upgrade to DePay PRO.' );
throw new Exception( 'To many requests! Please upgrade to DePay PRO.' );
} else if ( is_wp_error($usd_amount) || wp_remote_retrieve_response_code( $usd_amount ) != 200 ) {
Expand All @@ -202,7 +202,7 @@ public function get_accept( $order ) {
} else {
$get = wp_remote_get( sprintf( 'https://public.depay.com/currencies/%s', $currency ) );
}
if ( wp_remote_retrieve_response_code( $get ) === 429 ) {
if ( 429 === wp_remote_retrieve_response_code( $get ) ) {
DePay_WC_Payments::log( 'To many requests! Please upgrade to DePay PRO.' );
throw new Exception( 'To many requests! Please upgrade to DePay PRO.' );
} else if ( is_wp_error($get) || wp_remote_retrieve_response_code( $get ) != 200 ) {
Expand Down Expand Up @@ -262,7 +262,7 @@ public function get_accept( $order ) {

for ($i = 0; $i < count($responses); $i++) {
if ( 0 === $i % 2 ) { // even 0, 2, 4 ...
if ( $responses[$i]->status_code === 429 ) {
if ( 429 === $responses[$i]->status_code ) {
DePay_WC_Payments::log( 'To many requests! Please upgrade to DePay PRO.' );
throw new Exception( 'To many requests! Please upgrade to DePay PRO.' );
} else if ( $responses[$i]->success && $responses[$i+1]->success && !empty( $responses[$i]->body ) && !empty( $responses[$i+1]->body ) ) {
Expand Down
6 changes: 3 additions & 3 deletions includes/class-depay-wc-payments-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function track_payment( $request ) {
}
}

if( $api_key ) {
if ( $api_key ) {
$get = wp_remote_get(
sprintf( 'https://api.depay.com/v2/tokens/decimals/%s/%s', $accepted_payment->blockchain, $accepted_payment->token ),
array(
Expand Down Expand Up @@ -192,7 +192,7 @@ public function track_payment( $request ) {
if ( !empty($token) && $token->symbol === $currency ) {
$total_in_usd = 0;
} else {
if( $api_key ) {
if ( $api_key ) {
$get = wp_remote_get(
sprintf( 'https://api.depay.com/v2/currencies/%s', $currency ),
array(
Expand Down Expand Up @@ -288,7 +288,7 @@ public function track_payment( $request ) {
'base' => '0x9Db58B260EfAa2d6a94bEb7E219d073dF51cc7Bb'
];

if( $api_key ) {
if ( $api_key ) {
$endpoint = 'https://api.depay.com/v2/payments';
$headers = array(
'x-api-key' => $api_key,
Expand Down

0 comments on commit be3d089

Please sign in to comment.