Page MenuHomePhorge

StripeMockClient.php
No OneTemporary

StripeMockClient.php

<?php
namespace Tests;
use Stripe as StripeAPI;
class StripeMockClient implements StripeAPI\HttpClient\ClientInterface
{
private $responses = [];
public function request($method, $absUrl, $headers, $params, $hasFile)
{
if (empty($this->responses)) {
throw new \Exception("StripeMockClient: Missing response for $absUrl.");
}
$response = array_shift($this->responses);
return $response;
}
public function addResponse($body, $code = 200, $headers = [])
{
$this->responses[] = [$body, $code, $headers];
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Aug 25, 3:34 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
218017
Default Alt Text
StripeMockClient.php (591 B)

Event Timeline