public function testPaymentRefund()
 {
     $this->mockResponse($this->success_payment_refund_response());
     $token = 'pmt_4KQ2DD15gs2w8RS4M2MhBz1Q';
     $payment = Payment::refund($token);
     $this->assertTrue($payment->refunded);
     $this->assertEquals('Refunded', $payment->status);
     $this->assertEquals(0, $payment->fee_amount);
 }
Esempio n. 2
0
 /**
  * @expectedException         Everypay\Exception\CurlException
  * @expectedExceptionMessage  The returned response is not in json format
  */
 public function testPaymentError()
 {
     if ($this->isRemote()) {
         $this->markTestSkipped('Test not available in TEST_ENV REMOTE.');
     }
     $this->mockResponse($this->error_payment_response(), 'text/html');
     $token = 'pmt_4KQ2DD15gs2w8RS4M2MhBz1Q';
     $payment = Payment::refund($token);
 }
 /**
  * @expectedException         Everypay\Exception\CurlException
  * @expectedExceptionMessage  The returned response is not in json format
  */
 public function testPaymentError()
 {
     $this->mockResponse($this->error_payment_response(), 'text/html');
     $token = 'pmt_4KQ2DD15gs2w8RS4M2MhBz1Q';
     $payment = Payment::refund($token);
 }