CRM_Core_Payment_AuthorizeNetTrait uses trait:short
Class CRM_Core_Payment_AuthorizeNetTest
Tags
Table of Contents
Properties
- $baseUri : string
- The url to mock-interact with.
- $container : array<string|int, mixed>
- Array containing guzzle history of requests and responses.
- $guzzleClient : Client
- $isRecur : bool
- Is this a recurring transaction.
- $mockHandler : MockHandler
- Mockhandler to simulate guzzle requests.
- $processor : CRM_Core_Payment_AuthorizeNet
Methods
- getBaseUri() : mixed
- getContainer() : array<string|int, mixed>
- getExpectedRecurResponse() : string
- Get a successful response to setting up a recurring.
- getExpectedSinglePaymentRequest() : string
- Get the expected request from Authorize.net.
- getExpectedSinglePaymentResponse() : string
- Get the expected response from Authorize.net.
- getGuzzleClient() : Client
- getMockHandler() : MockHandler
- paymentProcessorAuthorizeNetCreate() : int
- Create test Authorize.net instance.
- setBaseUri() : mixed
- setContainer() : mixed
- setGuzzleClient() : mixed
- setMockHandler() : mixed
- assertRequestValid() : void
- Assert the request sent to Authorize.net contains the expected values.
- createAuthorizeNetProcessor() : mixed
- Create an AuthorizeNet processors with a configured mock handler.
- createMockHandler() : mixed
- createMockHandlerForFiles() : mixed
- getRequestBodies() : array<string|int, mixed>
- Get the bodies of the requests sent via Guzzle.
- getRequestHeaders() : array<string|int, mixed>
- Get the bodies of the requests sent via Guzzle.
- getRequestUrls() : array<string|int, mixed>
- Get the bodies of the requests sent via Guzzle.
- getResponseBodies() : array<string|int, mixed>
- Get the bodies of the responses returned via Guzzle.
- setUpClientWithHistoryContainer() : mixed
- Set up a guzzle client with a history container.
- setupMockHandler() : mixed
- Add a mock handler to the authorize.net processor for testing.
Properties
$baseUri
The url to mock-interact with.
protected
string
$baseUri
$container
Array containing guzzle history of requests and responses.
protected
array<string|int, mixed>
$container
$guzzleClient
protected
Client
$guzzleClient
$isRecur
Is this a recurring transaction.
protected
bool
$isRecur
= \FALSE
$mockHandler
Mockhandler to simulate guzzle requests.
protected
MockHandler
$mockHandler
$processor
protected
CRM_Core_Payment_AuthorizeNet
$processor
Methods
getBaseUri()
public
getBaseUri() : mixed
getContainer()
public
getContainer() : array<string|int, mixed>
Return values
array<string|int, mixed>getExpectedRecurResponse()
Get a successful response to setting up a recurring.
public
getExpectedRecurResponse() : string
Return values
stringgetExpectedSinglePaymentRequest()
Get the expected request from Authorize.net.
public
getExpectedSinglePaymentRequest() : string
Return values
stringgetExpectedSinglePaymentResponse()
Get the expected response from Authorize.net.
public
getExpectedSinglePaymentResponse() : string
Return values
stringgetGuzzleClient()
public
getGuzzleClient() : Client
Return values
ClientgetMockHandler()
public
getMockHandler() : MockHandler
Return values
MockHandlerpaymentProcessorAuthorizeNetCreate()
Create test Authorize.net instance.
public
paymentProcessorAuthorizeNetCreate([array<string|int, mixed> $params = [] ][, string $identifier = 'authorize_net' ]) : int
Parameters
- $params : array<string|int, mixed> = []
- $identifier : string = 'authorize_net'
Return values
intsetBaseUri()
public
setBaseUri(mixed $baseUri) : mixed
Parameters
- $baseUri : mixed
setContainer()
public
setContainer(array<string|int, mixed> $container) : mixed
Parameters
- $container : array<string|int, mixed>
setGuzzleClient()
public
setGuzzleClient(Client $guzzleClient) : mixed
Parameters
- $guzzleClient : Client
setMockHandler()
public
setMockHandler(MockHandler $mockHandler) : mixed
Parameters
- $mockHandler : MockHandler
assertRequestValid()
Assert the request sent to Authorize.net contains the expected values.
protected
assertRequestValid([array<string|int, mixed> $expected = [] ]) : void
Parameters
- $expected : array<string|int, mixed> = []
createAuthorizeNetProcessor()
Create an AuthorizeNet processors with a configured mock handler.
protected
createAuthorizeNetProcessor() : mixed
Tags
createMockHandler()
protected
createMockHandler(mixed $responses) : mixed
Parameters
- $responses : mixed
createMockHandlerForFiles()
protected
createMockHandlerForFiles(mixed $files) : mixed
Parameters
- $files : mixed
getRequestBodies()
Get the bodies of the requests sent via Guzzle.
protected
getRequestBodies() : array<string|int, mixed>
Return values
array<string|int, mixed>getRequestHeaders()
Get the bodies of the requests sent via Guzzle.
protected
getRequestHeaders() : array<string|int, mixed>
Return values
array<string|int, mixed>getRequestUrls()
Get the bodies of the requests sent via Guzzle.
protected
getRequestUrls() : array<string|int, mixed>
Return values
array<string|int, mixed>getResponseBodies()
Get the bodies of the responses returned via Guzzle.
protected
getResponseBodies() : array<string|int, mixed>
Return values
array<string|int, mixed>setUpClientWithHistoryContainer()
Set up a guzzle client with a history container.
protected
setUpClientWithHistoryContainer() : mixed
After you have run the requests you can inspect $this->container for the outgoing requests and incoming responses.
If $this->mock is defined then no outgoing http calls will be made and the responses configured on the handler will be returned instead of replies from a remote provider.
setupMockHandler()
Add a mock handler to the authorize.net processor for testing.
protected
setupMockHandler([int|null $id = null ]) : mixed
Parameters
- $id : int|null = null