Skip to content

Commit

Permalink
[MIT-1695]: Renamed camelCase variables to snake_case for consistency…
Browse files Browse the repository at this point in the history
… and to follow WP standard.
  • Loading branch information
Aashish committed Jan 9, 2024
1 parent fe2a1a2 commit 1b5c0a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions includes/class-omise-capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,16 @@ public function getInstallmentMinLimit()
/**
* Retrieves details of TrueMoney from capabilities.
*
* @param string $sourceType
* @param string $source_type
*/
public function get_truemoney_backend($sourceType)
public function get_truemoney_backend($source_type)
{
$truemoneySourceTypes = [Omise_Payment_Truemoney::WALLET, Omise_Payment_Truemoney::JUMPAPP];
$truemoney_source_types = [Omise_Payment_Truemoney::WALLET, Omise_Payment_Truemoney::JUMPAPP];

if (!in_array($sourceType, $truemoneySourceTypes)) {
if (!in_array($source_type, $truemoney_source_types)) {
return null;
}

return $this->getBackendByType($sourceType);
return $this->getBackendByType($source_type);
}
}
18 changes: 9 additions & 9 deletions includes/gateway/class-omise-payment-truemoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,26 +91,26 @@ public function charge($order_id, $order)

public function get_charge_request($order_id, $order)
{
$requestData = $this->build_charge_request(
$request_data = $this->build_charge_request(
$order_id,
$order,
$this->source_type,
$this->id . '_callback'
);

if (self::WALLET === $this->source_type) {
$phoneOption = $_POST['omise_phone_number_default'];
$isPhoneOptionChecked = isset($phoneOption) && 1 == $phoneOption;
$phone_number = $isPhoneOptionChecked ?
$phone_option = $_POST['omise_phone_number_default'];
$is_phone_option_checked = isset($phone_option) && 1 == $phone_option;
$phone_number = $is_phone_option_checked ?
$order->get_billing_phone() :
sanitize_text_field( $_POST['omise_phone_number'] );

$requestData['source'] = array_merge($requestData['source'], [
$request_data['source'] = array_merge($request_data['source'], [
'phone_number' => $phone_number
]);
}

return $requestData;
return $request_data;
}

/**
Expand All @@ -125,10 +125,10 @@ public function get_source()
return self::JUMPAPP;
}

$isJumpappEnabled = $capabilities->get_truemoney_backend(self::JUMPAPP);
$isWalletEnabled = $capabilities->get_truemoney_backend(self::WALLET);
$is_jumpapp_enabled = $capabilities->get_truemoney_backend(self::JUMPAPP);
$is_wallet_enabled = $capabilities->get_truemoney_backend(self::WALLET);

if (!empty($isWalletEnabled) && empty($isJumpappEnabled)) {
if (!empty($is_wallet_enabled) && empty($is_jumpapp_enabled)) {
return self::WALLET;
}

Expand Down

0 comments on commit 1b5c0a6

Please sign in to comment.