function testCreateResponseReturnsMobilePayment() { $c = new SimplePaymentReturningRequest('cancel', '345'); $data = array('payment' => array('type' => 'MobilePayment', 'unique_id' => 'a23', 'status' => 'canceled')); $resp = $c->createResponse($data); $this->assertIsA($resp, 'Hypercharge\\Payment'); $this->assertEqual('MobilePayment', $resp->type); $this->assertEqual('a23', $resp->unique_id); $this->assertEqual('canceled', $resp->status); $this->assertTrue($resp->isCanceled()); }
/** * see "reconcile" in Hypercharge API doc * @param string $unique_id a Payment.unique_id * @return Hypercharge\Payment * @throws Hypercharge\Errors\Error */ static function find($unique_id) { $request = new SimplePaymentReturningRequest('reconcile', $unique_id); $request->validate(); $factory = Config::getFactory(); $url = $factory->createPaymentUrl('reconcile'); return $factory->createWebservice()->call($url, $request); }