Page MenuHomePhorge

StripeMockClient.php
No OneTemporary

Authored By
Unknown
Size
593 B
Referenced Files
None
Subscribers
None

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
Sat, Apr 4, 1:55 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822051
Default Alt Text
StripeMockClient.php (593 B)

Event Timeline