コード例 #1
0
 public function testDeleteCustomerFailure()
 {
     $httpResponse = $this->getMockHttpResponse('DeleteCustomerFailure.txt');
     $response = new Response($this->getMockRequest(), $httpResponse->json());
     $this->assertFalse($response->isSuccessful());
     $this->assertFalse($response->isRedirect());
     $this->assertNull($response->getTransactionReference());
     $this->assertNull($response->getCustomerReference());
     $this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage());
 }
コード例 #2
0
 /**
  * @param Payment  $payment
  * @param Response $purchaseResponse
  *
  * @throws SavePaymentFailedException
  */
 protected function updatePaymentWithStripeCharge(Payment $payment, Response $purchaseResponse)
 {
     $payment->hasBeenPaidWithGatewayTransaction(new StripePaymentId($purchaseResponse->getTransactionReference()));
     try {
         $this->repository->markAsPaid($payment);
     } catch (SavePaymentFailedException $savePaymentFailedException) {
         throw $savePaymentFailedException;
     }
 }