\EventsForce\ResourcesPayments

Class for handling payments resource Api docs: http://docs.eventsforce.apiary.io/#reference/payments

Summary

Methods
Properties
Constants
setInvoice()
getInvoiceId()
__construct()
genEndpoint()
argsMerge()
getAll()
get()
setPostDefault()
post()
$post_defaults
No constants found
No protected methods found
$invoice
$endpoint_prefix
$client
N/A
No private methods found
No private properties found
N/A

Properties

$post_defaults

$post_defaults : array

Post payment defaults Can be set and updated using setPostDefault($key, $value)

Type

array

$invoice

$invoice : integer

Invoice id which we'll be looking in

Type

integer

$endpoint_prefix

$endpoint_prefix : string

Stores the endpoint prefix prior to all requests

Type

string

$client

$client : \EventsForce\Client

Stores an instance of the client for resources to Access

Type

\EventsForce\Client

Methods

setInvoice()

setInvoice(boolean  $invoice_id = false) : $this

Method to set the current invoice we're looking up in

Parameters

boolean $invoice_id

Throws

\EventsForce\Exceptions\InvalidArgumentException

Returns

$this

getInvoiceId()

getInvoiceId() : integer

Getter for invoice id

Throws

\EventsForce\Exceptions\Exception

Returns

integer

__construct()

__construct(\EventsForce\Client  $client) 

BaseResource constructor.

Parameters

\EventsForce\Client $client

genEndpoint()

genEndpoint(  $suffix = '') : string

Method to generate the endpoint Accepts either string or array e.g string 2/attendees.json or array [2, 'attendees.json'] both return events/2/attendees.json when the endpoint_prefix is events

Parameters

$suffix

Returns

string

argsMerge()

argsMerge(  $args = null,   $defaults = null) : array

method to merge array of arguments with defaults

Parameters

$args
  • passed in arguments
$defaults
  • default argument array to merge with

Returns

array

getAll()

getAll() : \Psr\Http\Message\StreamInterface

Method to get all payments for an invoice Api docs: http://docs.eventsforce.apiary.io/#reference/payments/get

Returns

\Psr\Http\Message\StreamInterface

get()

get(boolean  $payment_id = false) : \Psr\Http\Message\StreamInterface

Method to get a single payment under an invoice Api docs: http://docs.eventsforce.apiary.io/#reference/payments/invoicesinvoicenumberpaymentspaymentidjson/get

Parameters

boolean $payment_id

Throws

\EventsForce\Exceptions\EmptyResponseException
\EventsForce\Exceptions\Exception
\EventsForce\Exceptions\ResourceNotFound

Returns

\Psr\Http\Message\StreamInterface

setPostDefault()

setPostDefault(boolean  $key = false, null  $value = null) : $this

Method to set a post default This allows you to run multiple post payments where the post data isn't defined each time e.g ->setPostDefault('currencyCode', 'GBP') ->setPostDefault('comment', 'Made by My Application') ->setInvoice(1) ->post(['amount' => 2738.22]);

Parameters

boolean $key
null $value

Throws

\EventsForce\Resources\InvalidArgumentException;

Returns

$this

post()

post(array  $data = array()) : \Psr\Http\Message\StreamInterface

Method to post a payment against an invoice Api docs: http://docs.eventsforce.apiary.io/#reference/payments/invoicesinvoicenumberpaymentsjson/post THIS NEEDS TESTING WITH A FULL ACCESS API

Parameters

array $data

Throws

\EventsForce\Exceptions\EmptyResponseException
\EventsForce\Exceptions\InvalidArgumentException
\EventsForce\Exceptions\ResourceNotFound

Returns

\Psr\Http\Message\StreamInterface