public function setUp() { parent::setUp(); // создаём счёт Bill::truncate(); $bill = new Bill(); $bill->create(array('merchant_id' => 1, 'bill_id' => '1q2w3e', 'user' => 'tel:+7123', 'amount' => 123.45, 'ccy' => 'RUB', 'comment' => 'test', 'status' => 'waiting')); }
/** * Омена невозможна, текущий статус счёта не waiting * * @return void */ public function testRefundBillFailStatus() { // создаём счёт со статусом paid Bill::truncate(); $bill = new Bill(); $bill->create(array('merchant_id' => 1, 'bill_id' => '1q2w3e', 'user' => 'tel:+7123', 'amount' => 123.45, 'ccy' => 'RUB', 'comment' => 'test', 'status' => 'waiting')); $this->call('PUT', Config::get('ff-qiwi-gate::app.url') . '/qiwi/gate/api/v2/prv/1/bills/1q2w3e/refund/456', array('amount' => 50)); $oResponse = $this->response()->getData(); $this->assertEquals(210, $oResponse->response->result_code); $this->assertEquals(404, $this->client->getResponse()->getStatusCode()); }
public function setUp() { parent::setUp(); // создаём счёт Bill::truncate(); $bill = new Bill(); $bill->create(array('merchant_id' => 1, 'bill_id' => '1q2w3e', 'user' => 'tel:+7123', 'amount' => 123.45, 'ccy' => 'RUB', 'comment' => 'test', 'status' => 'paid')); // создаём возврат оплаты по счёту Refund::truncate(); $refund = new Refund(); $refund->create(array('bill_id' => 1, 'refund_id' => '456', 'amount' => 123.45, 'status' => 'processing')); }