function testWpf()
 {
     $data = $this->fixture('wpf_payment_request_simple.json');
     $requestXml = $this->fixture('wpf_payment_request_simple.xml');
     $responseXml = $this->fixture('wpf_payment_response_simple.xml');
     $this->curl->shouldReceive('xmlPost')->with('https://testpayment.hypercharge.net/payment', $requestXml)->andReturn($responseXml);
     $payment = Payment::wpf($data);
     $this->assertIsA($payment, 'Hypercharge\\Payment');
     $this->assertEqual($payment->type, 'WpfPayment');
 }
 function testWpfCancel()
 {
     $data = $this->fixture('wpf_payment_request_simple.json');
     $this->injectRedirectUrls($data);
     $payment = Payment::wpf($data);
     $this->assertIsA($payment, 'Hypercharge\\Payment');
     $this->assertTrue($payment->isNew());
     $this->assertPattern('/^[0-9a-f]{32}$/', $payment->unique_id);
     $response = Payment::cancel($payment->unique_id);
     $this->assertIsA($response, 'Hypercharge\\Payment');
     $this->assertTrue($response->isCanceled());
     $this->assertEqual($response->unique_id, $payment->unique_id);
     $this->assertNull($response->error);
     $o = Helper::extractRandomId($payment->transaction_id);
     $this->assertEqual($response->transaction_id, $data['transaction_id'] . '---' . $o->random_id);
     $this->assertEqual($response->amount, $data['amount']);
     $this->assertEqual($response->currency, $data['currency']);
     $this->assertFalse(empty($response->timestamp));
 }