示例#1
0
 public function testReportFailedPayment()
 {
     $api = new \CashWay\API(get_conf());
     $res = $api->reportFailedPayment('ord-id', 10.01, 'cust-id', 'cust-email', 'pprov', 'reasons');
     $this->assertEquals('POST', $res['method']);
     $this->assertEquals('/1/shops/me/events', $res['request']);
     $this->assertJsonStringEqualsJsonString(json_encode(array('event' => 'payment_failed', 'provider' => 'pprov', 'reason' => 'reasons', 'customer' => array('id' => 'cust-id', 'email' => 'cust-email'), 'order' => array('id' => 'ord-id', 'total' => 10.01), 'created_at' => date('c'))), $res['body']);
 }