Example #1
0
 public function testResourceNotFoundError()
 {
     setApiKey();
     try {
         $charge = \Conekta\Charge::find('1');
     } catch (Exception $e) {
         $this->assertTrue(strpos(get_class($e), 'ResourceNotFoundError') !== false);
     }
 }
Example #2
0
 public function testSuccesfulFindCharge()
 {
     $pm = self::$valid_payment_method;
     $card = self::$valid_visa_card;
     setApiKey();
     $cpm = \Conekta\Charge::create(array_merge($pm, $card));
     $this->assertTrue($cpm->status == 'paid');
     $pm = \Conekta\Charge::find($cpm->id);
     $this->assertTrue(strpos(get_class($pm), 'Charge') !== false);
 }