Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
paygw_paypal\paypal_helper Class Reference

Public Member Functions

 __construct (string $clientid, string $secret, bool $sandbox)
 helper constructor.
 
 capture_authorization (string $authorizationid, float $amount, string $currency, bool $final=true)
 Captures an authorized payment, by ID.
 
 capture_order (string $orderid)
 Captures order details from PayPal.
 
 get_order_details (string $orderid)
 

Public Attributes

string const CAPTURE_STATUS_COMPLETED = 'COMPLETED'
 The payment was authorized or the authorized payment was captured for the order.
 
string const ORDER_INTENT_CAPTURE = 'CAPTURE'
 The merchant intends to capture payment immediately after the customer makes a payment.
 
string const ORDER_STATUS_APPROVED = 'APPROVED'
 The customer approved the payment.
 

Constructor & Destructor Documentation

◆ __construct()

paygw_paypal\paypal_helper::__construct ( string $clientid,
string $secret,
bool $sandbox )

helper constructor.

Parameters
string$clientidThe client id.
string$secretPayPal secret.
bool$sandboxWhether we are working with the sandbox environment or not.

Member Function Documentation

◆ capture_authorization()

paygw_paypal\paypal_helper::capture_authorization ( string $authorizationid,
float $amount,
string $currency,
bool $final = true )

Captures an authorized payment, by ID.

Parameters
string$authorizationidThe PayPal-generated ID for the authorized payment to capture.
float$amountThe amount to capture.
string$currencyThe currency code for the amount.
bool$finalIndicates whether this is the final captures against the authorized payment.
Return values
array|nullFormatted API response.

◆ capture_order()

paygw_paypal\paypal_helper::capture_order ( string $orderid)

Captures order details from PayPal.

Parameters
string$orderidThe order we want to capture.
Return values
array|nullFormatted API response.

The documentation for this class was generated from the following file: