Documentation

CRM_Core_Payment_AuthorizeNetTrait uses trait:short

Class CRM_Core_Payment_AuthorizeNetTest

Tags
group

headless

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

$container

Array containing guzzle history of requests and responses.

protected array<string|int, mixed> $container

$mockHandler

Mockhandler to simulate guzzle requests.

protected MockHandler $mockHandler

Methods

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
string

getExpectedSinglePaymentRequest()

Get the expected request from Authorize.net.

public getExpectedSinglePaymentRequest() : string
Return values
string

getExpectedSinglePaymentResponse()

Get the expected response from Authorize.net.

public getExpectedSinglePaymentResponse() : string
Return values
string

getGuzzleClient()

public getGuzzleClient() : Client
Return values
Client

getMockHandler()

public getMockHandler() : MockHandler
Return values
MockHandler

paymentProcessorAuthorizeNetCreate()

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
int

setBaseUri()

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
throws
CRM_Core_Exception

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
Tags
throws
CRM_Core_Exception

        
On this page

Search results