VindiRoutes
has 34 functions (exceeds 20 allowed). Consider refactoring.
class VindiRoutes
{
/**
* @var VindiSettings
File RoutesApi.php
has 346 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
namespace VindiPaymentGateways;
class VindiRoutes
The class VindiRoutes has 25 public methods. Consider refactoring VindiRoutes to keep number of public methods under 10.
class VindiRoutes
{
/**
* @var VindiSettings
The class VindiRoutes has an overall complexity of 82 which is very high. The configured complexity threshold is 50.
class VindiRoutes
{
/**
* @var VindiSettings
Function getPaymentMethods
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
public function getPaymentMethods()
{
if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
$payment_methods = array(
Function isSubscriptionActive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
public function isSubscriptionActive($subscription_id)
{
$subscription_id = filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT);
if (isset($this->recentRequest)
&& $this->recentRequest['id'] == $subscription_id) {
The method isMerchantStatusTrialOrSandbox has a boolean flag argument $is_config, which is a certain sign of a Single Responsibility Principle violation.
public function isMerchantStatusTrialOrSandbox($is_config = false)
The method getMerchant has a boolean flag argument $is_config, which is a certain sign of a Single Responsibility Principle violation.
public function getMerchant($is_config = false)
The method suspendSubscription has a boolean flag argument $cancel_bills, which is a certain sign of a Single Responsibility Principle violation.
public function suspendSubscription($subscription_id, $cancel_bills = false)
Avoid assigning values to variables in if clauses and the like (line '476', column '20').
public function getMerchant($is_config = false)
{
if (false === ($merchant = get_transient('vindi_merchant')) || $is_config) {
$response = $this->api->request('merchant', 'GET');
Avoid assigning values to variables in if clauses and the like (line '282', column '7').
public function getSubscription($subscription_id)
{
if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
return $response;
Avoid assigning values to variables in if clauses and the like (line '231', column '10').
public function createSubscription($data)
{
if (($response = $this->api->request('subscriptions', 'POST', $data)) &&
isset($response['subscription']['id'])) {
Avoid assigning values to variables in if clauses and the like (line '269', column '9').
public function activateSubscription($subscription_id)
{
if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
return $response;
Avoid assigning values to variables in if clauses and the like (line '399', column '9').
public function createBill($data)
{
if ($response = $this->api->request('bills', 'POST', $data)) {
return $response['bill'];
}
Avoid assigning values to variables in if clauses and the like (line '424', column '20').
public function getPaymentMethods()
{
if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
$payment_methods = array(
Avoid assigning values to variables in if clauses and the like (line '413', column '9').
public function deleteBill($bill_id, $comments = '')
{
$query = '';
if($comments)
Avoid variables with short names like $id. Configured minimum length is 3.
public function findCustomerById($id)
The property $current_plan is not named in camelCase.
class VindiRoutes
{
/**
* @var VindiSettings
The property $vindi_settings is not named in camelCase.
class VindiRoutes
{
/**
* @var VindiSettings
Visibility must be declared on method "__construct"
function __construct(VindiSettings $vindi_settings)
Blank line found at start of control structure
isset($response['subscription']['id'])) {
Blank line found at start of control structure
if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
Only one argument is allowed per line in a multi-line function call
sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
Only one argument is allowed per line in a multi-line function call
sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
Spaces must be used to indent lines; tabs are not allowed
* @param int $subscription_id
Spaces must be used to indent lines; tabs are not allowed
*
Spaces must be used to indent lines; tabs are not allowed
*/
Line exceeds 120 characters; contains 141 characters
if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
Inline control structures are not allowed
if(!$cancel_bills)
Inline control structures are not allowed
if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
Spaces must be used to indent lines; tabs are not allowed
public function getSubscription($subscription_id)
Spaces must be used to indent lines; tabs are not allowed
* @return array|bool|mixed
Spaces must be used to indent lines; tabs are not allowed
{
Inline control structures are not allowed
if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
Line exceeds 120 characters; contains 142 characters
if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
Inline control structures are not allowed
if ($this->recentRequest['status'] != 'canceled')
Inline control structures are not allowed
if (false == $response)
Spaces must be used to indent lines; tabs are not allowed
* @param int $subscription_id
Spaces must be used to indent lines; tabs are not allowed
*
Spaces must be used to indent lines; tabs are not allowed
*/
Spaces must be used to indent lines; tabs are not allowed
return $response;
Line exceeds 120 characters; contains 122 characters
} else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
Inline control structures are not allowed
if (!$response || !$response['merchant'])
Spaces must be used to indent lines; tabs are not allowed
return false;
Inline control structures are not allowed
if(false !== $product)
Spaces must be used to indent lines; tabs are not allowed
* @return array|bool|mixed
Inline control structures are not allowed
if($comments)
Spaces must be used to indent lines; tabs are not allowed
if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
Inline control structures are not allowed
if (empty($customer))
Inline control structures are not allowed
if (end($response['payment_profiles']) !== null)
Inline control structures are not allowed
if (empty($response['charge']))
Inline control structures are not allowed
if (isset($response['bill']))
Line exceeds 120 characters; contains 133 characters
$response = $this->api->request(sprintf('charges/%s/refund', filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT)), 'POST', $data);
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['plan'];
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['plan'];
Multi-line function call not indented correctly; expected 8 spaces but found 6
'products/%s',
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request('customers', 'POST', $data);
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected 4 spaces, found 2
public function findCustomerById($id)
Line indented incorrectly; expected at least 8 spaces, found 6
'customers/%s',
Line indented incorrectly; expected at least 8 spaces, found 4
return $userExists;
Line indented incorrectly; expected at least 8 spaces, found 4
if(!$cancel_bills)
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(
Multi-line function call not indented correctly; expected 4 spaces but found 6
sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
Line indented incorrectly; expected 4 spaces, found 2
public $api;
Line indented incorrectly; expected at least 8 spaces, found 6
'plans/%s',
Line indented incorrectly; expected 4 spaces, found 2
public function createCustomer($data)
Line indented incorrectly; expected at least 8 spaces, found 6
'customers/%s',
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
), 'GET');
Line indented incorrectly; expected 8 spaces, found 4
if (($response = $this->api->request('subscriptions', 'POST', $data)) &&
Line indented incorrectly; expected at least 8 spaces, found 6
$query = '?cancel_bills=false';
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
), 'PUT', $data);
Line indented incorrectly; expected at least 8 spaces, found 6
'products/%s',
Multi-line function call not indented correctly; expected 8 spaces but found 6
'customers/%s',
Line indented incorrectly; expected at least 8 spaces, found 4
$productExists = isset($response['product']['id']) ? $response['product'] : false;
Expected 1 space after IF keyword; 0 found
if(!$cancel_bills)
Line indented incorrectly; expected at least 8 spaces, found 4
return $productExists;
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 6
return $response['charge'];
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 12 spaces, found 6
$subscription['bill'] = $response['bill'];
Line indented incorrectly; expected 4 spaces, found 2
public function activateSubscription($subscription_id)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 4 spaces, found 2
public function updatePlan($plan_id, $data)
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request('products', 'POST', $data);
Line indented incorrectly; expected 4 spaces, found 2
public function updateCustomer($user_id, $data)
Line indented incorrectly; expected 4 spaces, found 2
public function createSubscription($data)
Line indented incorrectly; expected at least 8 spaces, found 6
return $response;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Multi-line function call not indented correctly; expected 12 spaces but found 10
filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 12 spaces, found 6
return $subscription;
Line indented incorrectly; expected 4 spaces, found 2
public function suspendSubscription($subscription_id, $cancel_bills = false)
Line indented incorrectly; expected at least 8 spaces, found 4
$this->vindi_settings = $vindi_settings;
Line indented incorrectly; expected at least 8 spaces, found 6
$response = $this->api->request(
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 4 spaces, found 2
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected at least 8 spaces, found 4
$query = '';
Closing parenthesis of a multi-line function call must be on a line by itself
sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
Line indented incorrectly; expected 4 spaces, found 2
private $vindi_settings;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request('plans', 'POST', $data);
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['product'];
Line indented incorrectly; expected at least 12 spaces, found 10
return $response['customer'];
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected at least 12 spaces, found 6
$subscription = $response['subscription'];
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected at least 8 spaces, found 4
), 'PUT', $data);
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
), 'PUT', $data);
Line indented incorrectly; expected 4 spaces, found 2
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
'plans/%s',
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$this->api = $this->vindi_settings->api;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected 4 spaces, found 2
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
'customers/%s',
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['customer'];
Line indented incorrectly; expected at least 8 spaces, found 6
'customers/%s',
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['customer'];
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected at least 8 spaces, found 6
isset($response['subscription']['id'])) {
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 6
);
Line indented incorrectly; expected 4 spaces, found 2
public function createProduct($data)
Line indented incorrectly; expected 4 spaces, found 2
public function updateProduct($product_id, $data)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 6
'products/%s',
Line indented incorrectly; expected 4 spaces, found 2
public function deleteCustomer($user_id)
Line indented incorrectly; expected at least 8 spaces, found 4
), 'DELETE');
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
return $response;
Line indented incorrectly; expected at least 8 spaces, found 4
if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
Line indented incorrectly; expected 4 spaces, found 2
function __construct(VindiSettings $vindi_settings)
Line indented incorrectly; expected 4 spaces, found 2
public function findProductById($product_id)
Line indented incorrectly; expected 4 spaces, found 2
public function createPlan($data)
Multi-line function call not indented correctly; expected 8 spaces but found 6
'customers/%s',
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 6
sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 12 spaces, found 6
if ($this->recentRequest['status'] != 'canceled')
Line indented incorrectly; expected at least 12 spaces, found 6
return false;
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 12 spaces, found 10
$log['card_number'] = sprintf('**** *%s', substr($log['card_number'], -3));
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request('payment_profiles', 'POST', $data, $log);
Line indented incorrectly; expected at least 12 spaces, found 8
),
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 4 spaces, found 2
}
No space found after comma in function call
if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
Line indented incorrectly; expected at least 16 spaces, found 8
$this->recentRequest = $response;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 12 spaces, found 10
'price' => 0,
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected 4 spaces, found 2
public function deleteBill($bill_id, $comments = '')
Line indented incorrectly; expected at least 8 spaces, found 4
$query = '';
Line indented incorrectly; expected at least 12 spaces, found 6
return $response;
Usage of ELSE IF is discouraged; use ELSEIF instead
} else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
Line indented incorrectly; expected 4 spaces, found 2
public function isSubscriptionActive($subscription_id)
Line indented incorrectly; expected 4 spaces, found 2
public function verifyCustomerPaymentProfile($payment_profile_id)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
$transient_key = "vindi_product_{$code}";
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 12 spaces, found 8
'pricing_schema' => array(
Expected 1 space after IF keyword; 0 found
if($comments)
Line indented incorrectly; expected at least 8 spaces, found 6
$query = '?comments= ' . $comments;
Line indented incorrectly; expected at least 8 spaces, found 4
) {
Multi-line function call not indented correctly; expected 8 spaces but found 6
'products/%s',
Line indented incorrectly; expected at least 8 spaces, found 4
), 'GET');
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['product'];
Line indented incorrectly; expected at least 8 spaces, found 4
$userExists = isset($response['customer']['id']) ? $response['customer'] : false;
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($payment_profile_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 12 spaces, found 6
set_transient($transient_key, $product, 1 * HOUR_IN_SECONDS);
Line indented incorrectly; expected at least 12 spaces, found 6
return $this->createProduct(array(
Line indented incorrectly; expected 4 spaces, found 2
public function getPaymentMethods()
Line indented incorrectly; expected at least 16 spaces, found 6
if (false == $response)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Closing brace indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 6
'payment_profiles/%s/verify',
Line indented incorrectly; expected 4 spaces, found 2
public function findProductByCode($code)
Line indented incorrectly; expected at least 12 spaces, found 8
'code' => $code,
Line indented incorrectly; expected 4 spaces, found 2
public function createBill($data)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 8 spaces, found 4
if ($response = $this->api->request('bills', 'POST', $data)) {
Closing parenthesis of a multi-line function call must be on a line by itself
sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
Line indented incorrectly; expected at least 24 spaces, found 10
continue;
Line indented incorrectly; expected 20 spaces, found 8
if ('PaymentMethod::CreditCard' === $method['type']) {
Line indented incorrectly; expected at least 24 spaces, found 12
$method['payment_companies']
Line indented incorrectly; expected 4 spaces, found 2
public function getMerchant($is_config = false)
Line indented incorrectly; expected at least 8 spaces, found 4
$subscription_id = filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT);
Line indented incorrectly; expected at least 12 spaces, found 10
return $response['payment_profile'];
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
$product = $this->findProductByCode($code);
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 16 spaces, found 6
);
Line indented incorrectly; expected 16 spaces, found 6
foreach ($response['payment_methods'] as $method) {
Line indented incorrectly; expected 20 spaces, found 8
}
Line indented incorrectly; expected at least 24 spaces, found 10
$payment_methods['credit_card'] = array_merge(
Line indented incorrectly; expected at least 16 spaces, found 6
set_transient('vindi_payment_methods', $payment_methods, 1 * HOUR_IN_SECONDS);
Line indented incorrectly; expected at least 8 spaces, found 4
$this->api->accept_bank_slip = $payment_methods['bank_slip'];
Line indented incorrectly; expected at least 8 spaces, found 6
$merchant = $is_config ? $this->getMerchant($is_config) : $this->getMerchant();
Line indented incorrectly; expected at least 16 spaces, found 8
return true;
Line indented incorrectly; expected at least 8 spaces, found 4
), 'POST')['transaction']['status'];
Line indented incorrectly; expected at least 8 spaces, found 4
$log = $data;
Line indented incorrectly; expected at least 8 spaces, found 4
$code = sanitize_text_field($code);
Expected 1 space after IF keyword; 0 found
if(false !== $product)
Line indented incorrectly; expected at least 8 spaces, found 4
{
Line indented incorrectly; expected at least 12 spaces, found 6
));
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf('products?query=code:%s', $code), 'GET');
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 16 spaces, found 8
return false;
Line indented incorrectly; expected 20 spaces, found 8
if ('active' !== $method['status']) {
Line indented incorrectly; expected at least 24 spaces, found 12
$payment_methods['credit_card'],
Line indented incorrectly; expected at least 8 spaces, found 6
&& $this->recentRequest['id'] == $subscription_id) {
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->getSubscription($subscription_id);
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Multi-line function call not indented correctly; expected 8 spaces but found 6
'payment_profiles/%s/verify',
Line indented incorrectly; expected at least 12 spaces, found 10
$log['card_cvv'] = '***';
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 6
return $product;
Line indented incorrectly; expected 4 spaces, found 2
public function findOrCreateProduct($name, $code)
Line indented incorrectly; expected at least 16 spaces, found 6
$response = $this->api->request('payment_methods', 'GET');
Line indented incorrectly; expected 20 spaces, found 8
}
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 12 spaces, found 6
if ($response['status'] != 'canceled') {
Line indented incorrectly; expected at least 8 spaces, found 4
return 'success' === $this->api->request(sprintf(
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 8 spaces, found 4
if (false === $product)
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected 8 spaces, found 4
if (isset($this->recentRequest)
Line indented incorrectly; expected at least 8 spaces, found 4
if(false !== $product)
Line indented incorrectly; expected at least 8 spaces, found 4
$name = sanitize_text_field($name);
Multi-line function call not indented correctly; expected 14 spaces but found 12
$payment_methods['credit_card'],
Multi-line function call not indented correctly; expected 14 spaces but found 12
$method['payment_companies']
Line indented incorrectly; expected 16 spaces, found 6
}
Line indented incorrectly; expected at least 8 spaces, found 4
return $payment_methods;
Line indented incorrectly; expected 4 spaces, found 2
public function isMerchantStatusTrialOrSandbox($is_config = false)
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 12 spaces, found 6
if (!$response || !$response['merchant'])
Line indented incorrectly; expected at least 8 spaces, found 4
return $merchant;
Line indented incorrectly; expected at least 8 spaces, found 4
return $this->current_plan;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
if (empty($customer))
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected 8 spaces, found 4
if (false === empty($response['products'])) {
Expected 1 space after closing parenthesis; found 5
if (false === $product)
Multi-line function call not indented correctly; expected 4 spaces but found 6
sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
Line indented incorrectly; expected at least 8 spaces, found 4
$this->current_plan = $response['plan'];
Multi-line function call not indented correctly; expected 8 spaces but found 6
'bills/%s',
Line indented incorrectly; expected at least 12 spaces, found 6
$this->current_plan = false;
Line indented incorrectly; expected at least 8 spaces, found 6
filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
), 'GET');
Line indented incorrectly; expected 8 spaces, found 4
if (isset($response['charge'])) {
Line indented incorrectly; expected 4 spaces, found 2
public function createCustomerPaymentProfile($data)
Line indented incorrectly; expected at least 12 spaces, found 6
$product = end($response['products']);
Line indented incorrectly; expected 8 spaces, found 4
if ($response = $this->api->request(
Line indented incorrectly; expected at least 8 spaces, found 6
return false;
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
if (empty($response['charge']))
Line indented incorrectly; expected 8 spaces, found 4
if (empty($response['plan'])) {
Line indented incorrectly; expected at least 12 spaces, found 6
return false;
Line indented incorrectly; expected at least 8 spaces, found 4
$user_vindi_id = filter_var($user_vindi_id, FILTER_SANITIZE_NUMBER_INT);
Line indented incorrectly; expected at least 12 spaces, found 8
return true;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$code = sanitize_text_field($code);
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 24 spaces, found 10
$payment_methods['bank_slip'] = true;
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 12 spaces, found 10
return true;
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 8 spaces, found 4
if (false === ($merchant = get_transient('vindi_merchant')) || $is_config) {
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf('charges/%s/refund', filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT)), 'POST', $data);
Line indented incorrectly; expected at least 12 spaces, found 6
return $response['charge'];
Line indented incorrectly; expected 8 spaces, found 4
if ($response && array_key_exists('status', $response)) {
Line indented incorrectly; expected 12 spaces, found 6
}
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected at least 8 spaces, found 4
$product = get_transient($transient_key);
Line indented incorrectly; expected at least 12 spaces, found 8
'status' => 'active',
Line indented incorrectly; expected at least 8 spaces, found 4
return $product;
Line indented incorrectly; expected at least 12 spaces, found 6
return $response['bill'];
Line indented incorrectly; expected at least 8 spaces, found 4
if($comments)
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected at least 12 spaces, found 8
'bank_slip' => false,
Line indented incorrectly; expected at least 36 spaces, found 10
);
Line indented incorrectly; expected at least 12 spaces, found 6
$merchant = $response['merchant'];
Line indented incorrectly; expected at least 4 spaces, found 2
{
Line indented incorrectly; expected 4 spaces, found 2
public function getPaymentProfile($user_vindi_id)
Line indented incorrectly; expected 8 spaces, found 4
if (null === $this->api->accept_bank_slip) {
Line indented incorrectly; expected at least 4 spaces, found 2
{
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($payment_profile_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 4
return $product;
Line indented incorrectly; expected at least 12 spaces, found 8
'name' => $name,
Line indented incorrectly; expected at least 8 spaces, found 6
sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
Line indented incorrectly; expected 8 spaces, found 4
if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
Line indented incorrectly; expected at least 12 spaces, found 6
$payment_methods = array(
Line indented incorrectly; expected at least 12 spaces, found 8
'credit_card' => array(),
Line indented incorrectly; expected 20 spaces, found 8
} else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
Line indented incorrectly; expected 4 spaces, found 2
public function getCharge($charge_id)
Line indented incorrectly; expected at least 8 spaces, found 6
return false;
Line indented incorrectly; expected 4 spaces, found 2
public function getPlan($plan_id)
Line indented incorrectly; expected at least 8 spaces, found 6
return false;
Line indented incorrectly; expected 4 spaces, found 2
}
Multi-line function call not indented correctly; expected 8 spaces but found 6
filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT)
Line indented incorrectly; expected at least 8 spaces, found 6
return $response['bill'];
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request("charges/" . filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT), 'GET');
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request("plans/" . filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT), 'GET');
Line indented incorrectly; expected at least 8 spaces, found 4
$customer = $this->findCustomerById($user_vindi_id);
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request('payment_profiles?query='.$query, 'GET');
Line indented incorrectly; expected at least 12 spaces, found 6
$this->getPaymentMethods();
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected 8 spaces, found 4
}
Line indented incorrectly; expected at least 8 spaces, found 4
$response = $this->api->request(sprintf(
Line indented incorrectly; expected at least 8 spaces, found 4
if (isset($response['bill']))
Line indented incorrectly; expected at least 12 spaces, found 6
set_transient('vindi_merchant', $merchant, 1 * HOUR_IN_SECONDS);
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 8 spaces, found 4
$query = urlencode("customer_id={$customer['id']} status=active type=PaymentProfile::CreditCard");
Line indented incorrectly; expected 4 spaces, found 2
public function findBillById($bill_id)
Line indented incorrectly; expected 4 spaces, found 2
public function refundCharge($charge_id, $data)
A closing tag is not permitted at the end of a PHP file
?>
Line indented incorrectly; expected at least 8 spaces, found 4
if (end($response['payment_profiles']) !== null)
Line indented incorrectly; expected at least 8 spaces, found 4
return $response['charge'];
Line indented incorrectly; expected at least 8 spaces, found 6
return end($response['payment_profiles']);
Line indented incorrectly; expected 4 spaces, found 2
public function acceptBankSlip()
Line indented incorrectly; expected 4 spaces, found 2
}
Line indented incorrectly; expected at least 12 spaces, found 6
$response = $this->api->request('merchant', 'GET');
Line indented incorrectly; expected at least 12 spaces, found 8
return false;
Line indented incorrectly; expected at least 8 spaces, found 4
return false;
Line indented incorrectly; expected at least 8 spaces, found 4
return $this->api->accept_bank_slip;
Line indented incorrectly; expected at least 8 spaces, found 6
'bills/%s',
Line indented incorrectly; expected at least 4 spaces, found 2
{
There are no issues that match your filters.