Payment extends UbexPayModel
Payment Class
Table of Contents
- $approvedUrl : string
- $baseUrl : string
- $credentials : array<string|int, mixed>
- $payer : Payer
- $prop : array<string|int, mixed>
- $redirectUrls : RedirectUrls
- $transaction : Transaction
- __construct() : mixed
- Set the API server base URL.
- create() : mixed
- Generates the access token Uses the generated access token to process Set the $approveUrl link that has been validated.
- execute() : mixed
- Makes the API request
- getApprovedUrl() : string
- Gets the approved URL
- getCredentials() : string
- Gets the credentials, an array of client id and client secret
- getPayer() : mixed
- getRedirectUrls() : mixed
- getTransaction() : mixed
- setApprovedUrl() : Payment
- Set the validated Url.
- setCredentials() : Payment
- Sets the credentials, an array of client id and client secret
- setPayer() : Payment
- Sets payer object
- setRedirectUrls() : Payment
- Sets Redirect URLs
- setTransaction() : Payment
- Sets Trasaction Object
- getAccessToken() : string
- Send merchant credentials to API server.
- sendTransactionInfo() : mixed
- Send payment details to server.
Properties
$approvedUrl
public
string
$approvedUrl
Approved payment URL
$baseUrl
public
string
$baseUrl
Base API URL
$credentials
public
array<string|int, mixed>
$credentials
Merchant credentials[cliend id and secret]
$payer
public
Payer
$payer
Payer Object
$prop
public
array<string|int, mixed>
$prop
Class properties
$redirectUrls
public
RedirectUrls
$redirectUrls
Redirect URLs object
$transaction
public
Transaction
$transaction
Transaction object
Methods
__construct()
Set the API server base URL.
public
__construct(string $baseUrl) : mixed
Parameters
- $baseUrl : string
-
API Server base URL
Return values
mixed —create()
Generates the access token Uses the generated access token to process Set the $approveUrl link that has been validated.
public
create() : mixed
Return values
mixed —execute()
Makes the API request
public
execute(string $url, string $method, mixed $payload[, mixed $headers = null ]) : mixed
Parameters
- $url : string
-
Request url
- $method : string
-
Request method POST or GET
- $payload : mixed
-
Request Body
- $headers : mixed = null
Return values
mixed —Server response
getApprovedUrl()
Gets the approved URL
public
getApprovedUrl() : string
Return values
string —$approvedUrl
getCredentials()
Gets the credentials, an array of client id and client secret
public
getCredentials() : string
Return values
string —$credentials
getPayer()
public
getPayer() : mixed
Return values
mixed —getRedirectUrls()
public
getRedirectUrls() : mixed
Return values
mixed —getTransaction()
public
getTransaction() : mixed
Return values
mixed —setApprovedUrl()
Set the validated Url.
public
setApprovedUrl(mixed $url) : Payment
Parameters
- $url : mixed
Return values
Payment —setCredentials()
Sets the credentials, an array of client id and client secret
public
setCredentials(array<string|int, mixed> $credentials) : Payment
Parameters
- $credentials : array<string|int, mixed>
Return values
Payment —setPayer()
Sets payer object
public
setPayer(Payer $payer) : Payment
Parameters
- $payer : Payer
Return values
Payment —$this
setRedirectUrls()
Sets Redirect URLs
public
setRedirectUrls(RedirectUrls $redirectUrls) : Payment
Parameters
- $redirectUrls : RedirectUrls
Return values
Payment —setTransaction()
Sets Trasaction Object
public
setTransaction(Transaction $transaction) : Payment
Parameters
- $transaction : Transaction
Return values
Payment —getAccessToken()
Send merchant credentials to API server.
private
getAccessToken() : string
Return Access Token received from the API
Return values
string —$response
sendTransactionInfo()
Send payment details to server.
private
sendTransactionInfo(string $token) : mixed
Parameters
- $token : string
-
the access token
Return values
mixed —Response received from the API