Class Socialveo\WebApi\Controllers\PaymentsController

InheritanceSocialveo\WebApi\Controllers\PaymentsController » Socialveo\WebApi\Controllers\RestApiController » Phalcon\Mvc\Controller
Uses TraitsSocialveo\Core\Translatable

Class PaymentsController

Public Methods

Hide inherited methods

MethodDescriptionDefined By
_handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
_t() Gets translations Socialveo\Core\Translatable
afterExecuteRoute() After execute route, change return value to json Socialveo\WebApi\Controllers\RestApiController
beforeExecuteRoute() Before execute route, remove extra params Socialveo\WebApi\Controllers\RestApiController
checkClientCredentials() Checks client credentials Socialveo\WebApi\Controllers\RestApiController
createAction() Make payment action (premium account subscription) Socialveo\WebApi\Controllers\PaymentsController
decrypt() Decrypt value Socialveo\WebApi\Controllers\RestApiController
encrypt() Encrypt value Socialveo\WebApi\Controllers\RestApiController
getAction() Returns a payment resource Socialveo\WebApi\Controllers\PaymentsController
getArrayFromParam() Returns array from params Socialveo\WebApi\Controllers\RestApiController
getLanguage() Gets language code Socialveo\WebApi\Controllers\RestApiController
getParams() Gets request params for Socialveo::filteredFind() Socialveo\WebApi\Controllers\RestApiController
getRequestData() Returns request data Socialveo\WebApi\Controllers\RestApiController
getRequiredParam() Get required param Socialveo\WebApi\Controllers\RestApiController
getToken() Get token Socialveo\WebApi\Controllers\RestApiController
getTranslation() Gets translations Socialveo\WebApi\Controllers\RestApiController
handleError() Handle errors Socialveo\WebApi\Controllers\RestApiController
handleException() Handle exceptions Socialveo\WebApi\Controllers\RestApiController
initialize() Initialize controller Socialveo\WebApi\Controllers\RestApiController
invalidMethodAction() Action trigger when invalid action tried run Socialveo\WebApi\Controllers\RestApiController
listAction() Returns a list of payments of a given user Socialveo\WebApi\Controllers\PaymentsController
notFoundAction() Not found action Socialveo\WebApi\Controllers\RestApiController
posts() Gets posts Socialveo\WebApi\Controllers\RestApiController
replaceParam() Replace param Socialveo\WebApi\Controllers\RestApiController
respondWithItem() Response with item // * @deprecated Socialveo\WebApi\Controllers\RestApiController
sendJsonContent() Send response as json content and exit Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRaw() Send json content Socialveo\WebApi\Controllers\RestApiController
sendJsonContentRawStatic() Send json content static Socialveo\WebApi\Controllers\RestApiController
setDefaultParam() Set default option Socialveo\WebApi\Controllers\RestApiController
t() Gets translations Socialveo\Core\Translatable
unsetParam() Unset get param Socialveo\WebApi\Controllers\RestApiController

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
checkAccess() Checks during the init of controller whether user is a guest. Socialveo\WebApi\Controllers\RestApiController
log() Log full request data for debug Socialveo\WebApi\Controllers\RestApiController
objectsToArray() Convert objects to arrays Socialveo\WebApi\Controllers\RestApiController

Method Details

createAction() public method

Make payment action (premium account subscription)

Notice. This action is disabled, the reasons can be: not implemented, unsafe, duplicated or deprecated (autodetect: disabled in the router)
/payments/create

Method: POST

Access: Public

Parameters:

firstName required string customer firstname (this does not have to be equal to user firstname)
lastName required string customer lastname (this does not have to be equal to user lastname)
number required string credit card number (eg. '4242424242424242')
expiryMonth required string expiration month ('01' for January, '02' for February, etc.)
expiryYear required string expiration year (eg. '2020')
cvv required string cvv number (eg. '123')
email required string customer email (this does not have to be equal to user email)
billingAddress1 required string customer billing address (street, appartment no, etc.)
billingCountry required string custommer billing country, two letter code (eg. 'US', 'AU', 'PL', 'IT', etc.)
billingCity required string custommer billing city
billingPostcode required string custommer billing post code
billingState required string custommer billing state
storeCard optional boolean for true a token will be generated and stored for future transactions (auto-billing), default is false

Sample response:

{
    'uuid': '3783fb66-b5e7-11e4-b252-b88d1200a92c',
    'user_uuid': '32067218-b5e7-11e4-a722-b88d1200a92c',
    'payment_processor': 'PayPal_REST',
    'transaction_no': 'AP_3452643',
    'amount': 9.99,
    'currency': 'USD',
    'properties': null,
    'status_code': null,
    'created': '2015-02-16 15:22:20',
    'updated': '2015-02-16 15:22:20'
}

public mixed createAction ( )
throws Exception
getAction() public method

Returns a payment resource

/payments/{payment_uuid}

Method: GET

Access: Public

Parameters:

{payment_uuid} required string post uuid

Returns: Payment

Sample response:

{
    "status": "OK",
    "data":{
        "uuid": "3783fb66-b5e7-11e4-b252-b88d1200a92c",
        "user_uuid": "32067218-b5e7-11e4-a722-b88d1200a92c",
        "payment_processor": "PayPal_REST",
        "transaction_no": "AP_3452643",
        "amount": 9.99,
        "currency": "USD",
        ...
    },
    "timestamp": 1234567890
}

public mixed getAction ( $payment_uuid )
$payment_uuid string

Payment UUID is passed in the request URI

listAction() public method

Returns a list of payments of a given user

/payments

Method: GET

Access: Public

Parameters:

page or offset optional integer page start or offset
limit optional integer page limit
sortby[property]=order optional array sort by property value, order either desc or asc
filterby[property][operator]=value optional array filter (limit results) by given property, operator eq (=), gt (>), ge(>=), lt(<), le(<=), ne(<>), like
uuids optional string or array list of item UUIDs to fetch, array or string separated by commas, when it used other parameters will be ignored
language optional string language code

Filter by: Payment

Returns: Payment []

Sample response:

{
    "status": "OK",
    "data":[
        {"type": "payment", "uuid": "a479b438-14a8-11e6-ac83-54bef75c7a3f", "user_uuid": "a66b8654-14a8-11e6-af87-54bef75c7a3f",…},
        {"type": "payment", "uuid": "5a15e760-27ed-11e6-8d4a-54bef75c7a3f", "user_uuid": "5ac94e9a-27ed-11e6-9916-54bef75c7a3f",…},
        {"type": "payment", "uuid": "0449c1f2-27f8-11e6-be68-54bef75c7a3f", "user_uuid": "04577e6e-27f8-11e6-b0cf-54bef75c7a3f",…},
        {"type": "payment", "uuid": "4622f77e-27f8-11e6-98d1-54bef75c7a3f", "user_uuid": "4631a06c-27f8-11e6-94b3-54bef75c7a3f",…},
        ...
    ],
    "count":{"offset": 0, "limit": 10, "total": 12},
    "timestamp": 1234567890
}

public mixed listAction ( )