function testMobileRefund() { $payment = $this->testMobileSubmit(); $response = Payment::refund($payment->unique_id); $this->assertNull($response->error, "error %s . error:\n" . $response->error); $this->assertIsA($response, 'Hypercharge\\Payment'); $this->assertEqual($response->type, 'MobilePayment'); $this->assertEqual($response->status, 'refunded', 'status %s'); $this->assertTrue($response->isRefunded(), 'isRefunded() %s'); $this->assertEqual($response->unique_id, $payment->unique_id, 'unique_id %s'); $this->assertEqual($response->transaction_id, $payment->transaction_id); $this->assertFalse(empty($response->timestamp)); //$this->assertEqual($response->descriptor, 'sankyu.com/bogus +49123456789'); $this->assertIsA($response->transactions, 'array'); $this->assertIsA($response->transactions[0], 'Hypercharge\\Transaction'); $trx = $response->transactions[0]; $this->assertEqual($trx->getType(), 'sale'); $this->assertTrue($trx->isRefunded()); $this->assertEqual($trx->amount, $payment->amount); $this->assertEqual($trx->currency, $payment->currency); $this->assertEqual($trx->transaction_id, $payment->transaction_id); }