<commit_before><?php
  class Test_SmartCoin_Charge extends UnitTestCase {

    function test_create_and_retrieve_charge() {
      $api_key = 'pk_test_d1331efc0f6fde:';
      $api_keys = 'pk_test_d1331efc0f6fde:sk_test_c1a09efd8eaa36';
      $params = array('number' => 4242424242424242,
                      'exp_month' => 11,
                      'exp_year' => 2017,
                      'name' => '<NAME>');
      $token = \SmartCoin\Token::create($params, $api_key);

      $params = array(
          'amount' => 1000,
          'currency' => 'brl',
          'card' => $token->id
        );

      $c = Charge::create($params, $api_keys);
      $r = Charge::retrieve($c->id, $api_keys);
      $this->assertEqual($c->id,$r->id);
      $this->assertEqual($c->card->id,$token->card->id);
    }

    function test_capture_charge() {
      $api_key = 'pk_test_d1331efc0f6fde:';
      $api_keys = 'pk_test_d1331efc0f6fde:sk_test_c1a09efd8eaa36';
      $params = array('number' => 4242424242424242,
                      'exp_month' => 11,
                      'exp_year' => 2017,
                      'name' => '<NAME>');
      $token = \SmartCoin\Token::create($params, $api_keys);
<commit_msg>Include test in ChargeTest to check if Card type is correct<commit_after><?php
  class Test_SmartCoin_Charge extends UnitTestCase {

    function test_create_and_retrieve_charge() {
      $api_key = 'pk_test_d1331efc0f6fde:';
      $api_keys = 'pk_test_d1331efc0f6fde:sk_test_c1a09efd8eaa36';
      $params = array('number' => 4242424242424242,
                      'exp_month' => 11,
                      'exp_year' => 2017,
                      'name' => '<NAME>');
      $token = \SmartCoin\Token::create($params, $api_key);

      $params = array(
          'amount' => 1000,
          'currency' => 'brl',
          'card' => $token->id
        );

      $c = Charge::create($params, $api_keys);
      $r = Charge::retrieve($c->id, $api_keys);
      $this->assertEqual($c->id,$r->id);
      $this->assertEqual($c->card->type,'Visa');
      $this->assertEqual($c->card->id,$token->card->id);
    }

    function test_capture_charge() {
      $api_key = 'pk_test_d1331efc0f6fde:';
      $api_keys = 'pk_test_d1331efc0f6fde:sk_test_c1a09efd8eaa36';
      $params = array('number' => 4242424242424242,
                      'exp_month' => 11,
                      'exp_year' => 2017,
                      'name' => '<NAME>');
      $token = \SmartCoin\Token::create($params, $api_keys);

{'fraction_non_alphanumeric': 0.16057808109193095, 'fraction_numerical': 0.067442794058611, 'mean_word_length': 2.3271028037383177, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 52, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4126193', 'n_tokens_mistral': 999, 'n_tokens_neox': 873, 'n_words': 125}