rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -48,14 +48,16 @@ class Wincher_Account_Action {
try {
$results = $this->client->get( self::ACCOUNT_URL );
$usage = $results['limits']['keywords']['usage'];
$limit = $results['limits']['keywords']['limit'];
$usage = $results['limits']['keywords']['usage'];
$limit = $results['limits']['keywords']['limit'];
$history = $results['limits']['history_days'];
return (object) [
'canTrack' => \is_null( $limit ) || $usage < $limit,
'limit' => $limit,
'usage' => $usage,
'status' => 200,
'canTrack' => \is_null( $limit ) || $usage < $limit,
'limit' => $limit,
'usage' => $usage,
'historyDays' => $history,
'status' => 200,
];
} catch ( \Exception $e ) {
return (object) [
@@ -72,13 +74,13 @@ class Wincher_Account_Action {
*/
public function get_upgrade_campaign() {
try {
$result = $this->client->get( self::UPGRADE_CAMPAIGN_URL );
$type = $result['type'];
$months = $result['months'];
$result = $this->client->get( self::UPGRADE_CAMPAIGN_URL );
$type = isset( $result['type'] ) ? $result['type'] : null;
$months = isset( $result['months'] ) ? $result['months'] : null;
$discount = isset( $result['value'] ) ? $result['value'] : null;
// We display upgrade discount only if it's a rate discount and positive months.
if ( $type === 'RATE' && $months && $months > 0 ) {
$discount = $result['value'];
// We display upgrade discount only if it's a rate discount and positive months/discount.
if ( $type === 'RATE' && $months && $discount ) {
return (object) [
'discount' => $discount,