public function test_verifyDeactivation()
 {
     // deactivation && verify --> get null
     ClientAPI::activate('payment', $this->paymentApiKey, site_url(), '', FALSE);
     $oir = ClientAPI::verify('payment', $this->paymentApiKey, site_url());
     $this->assertNull($oir);
 }
 /**
  * @action wp_ajax_activate_action
  */
 public function callback_activation()
 {
     wp_verify_nonce($_POST['activation_nonce'], static::$nonce_action) or die('nonce verification failed.');
     $key_type = sanitize_text_field($_POST['key_type']);
     $key_value = sanitize_text_field($_POST['key_value']);
     $site_url = sanitize_text_field($_POST['site_url']);
     $company_name = get_bloginfo('name');
     $activation = ClientAPI::activate($key_type, $key_value, $site_url, $company_name, TRUE);
     $info_model = new WSKL_Auth_Info($key_type);
     if ($activation instanceof OrderItemRelation) {
         $info_model->set_oir($activation);
         $info_model->save();
         wp_send_json_success();
     } else {
         $info_model->reset();
         wp_send_json_error();
     }
     die;
 }
 public function setUp()
 {
     update_test_cassandra_url();
     $this->oir = ClientAPI::activate('payment', $this->paymentApiKey, site_url(), '', TRUE);
     $this->assertTrue($this->oir instanceof OrderItemRelation);
 }
 public function setUp()
 {
     update_test_cassandra_url();
     ClientAPI::activate('marketing', $this->marketingApiKey, site_url(), '', TRUE);
     $this->testPost = $this->factory->post->create(array('post_title' => 'POST TITLE', 'post_content' => 'TEST POST', 'post_author' => '1'));
 }