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