Api
in package
Class API perfect money
Table of Contents
- $account_id : mixed
- $check_ip : mixed
- $currency : mixed
- $html_submit : mixed
- $nopayment_url : mixed
- $nopayment_url_method : mixed
- $passphrase : mixed
- $password : mixed
- $payee_name : mixed
- $payment_url : mixed
- $payment_url_method : mixed
- $status_url : mixed
- $wallet : mixed
- __construct() : null
- PM API class constructor
- checkPay() : array<string|int, mixed>
- Check incoming payment request
- getBalance() : array<string|int, mixed>
- Get balances
- getForm() : string
- Gets a payment form
Properties
$account_id
private
mixed
$account_id
$check_ip
private
mixed
$check_ip
$currency
private
mixed
$currency
$html_submit
private
mixed
$html_submit
$nopayment_url
private
mixed
$nopayment_url
$nopayment_url_method
private
mixed
$nopayment_url_method
$passphrase
private
mixed
$passphrase
$password
private
mixed
$password
$payee_name
private
mixed
$payee_name
$payment_url
private
mixed
$payment_url
$payment_url_method
private
mixed
$payment_url_method
$status_url
private
mixed
$status_url
$wallet
private
mixed
$wallet
Methods
__construct()
PM API class constructor
public
__construct(string $wallet, string $passphrase, string $status_url, string $payment_url, string $nopayment_url, string $payee_name[, int $account_id = NULL ][, string $password = NULL ][, string $currency = 'USD' ][, string $payment_url_method = 'GET' ][, string $nopayment_url_method = 'GET' ][, string $html_submit = '<input type="submit" value="Pay">' ][, string $check_ip = true ]) : null
Parameters
- $wallet : string
-
Perfect money wallet
- $passphrase : string
-
Alternative passphrase
- $status_url : string
-
Link to which payment notification will be sent
- $payment_url : string
-
Link where the user will be redirected upon successful payment
- $nopayment_url : string
-
Link where the user will be redirected upon successful payment
- $payee_name : string
-
Receiver name
- $account_id : int = NULL
-
Account id (specify NULL if you do not need to request a balance or send money)
- $password : string = NULL
-
Password account
- $currency : string = 'USD'
-
USD, EUR or OAU. Currency must correspond to wallet you selected
- $payment_url_method : string = 'GET'
-
what method to use for payment_url
- $nopayment_url_method : string = 'GET'
-
what method to use for nopayment_url
- $html_submit : string = '<input type="submit" value="Pay">'
-
Html code for submit button
- $check_ip : string = true
-
Check ip for status_url, set false on problems
Return values
null —checkPay()
Check incoming payment request
public
checkPay([string $data = false ]) : array<string|int, mixed>
Parameters
- $data : string = false
-
Incoming data array, if set to false uses $_POST
Return values
array<string|int, mixed> —On error returns an array with 'status' = false and a description of the error in the 'error' field.
Returns an array on success:
success : true
order_id : Order id
amount : Amount
transaction_id : Transaction id in perfect money
payer : Payer wallet
timestampgmt : Operation time in GMT
getBalance()
Get balances
public
getBalance() : array<string|int, mixed>
Return values
array<string|int, mixed> —Returns an array with the key 'ERROR' on error containing an error
On success, returns an array with of wallets and balances on them
getForm()
Gets a payment form
public
getForm(string $order_id, string $amount, string $description) : string
Parameters
- $order_id : string
-
Order id in your system
- $amount : string
-
Amount money
- $description : string
-
Description payment
Return values
string —Html code