MDL-70287 core_payment: Improving existing and missing phpdocs

This commit is contained in:
Shamim Rezaie 2021-02-09 17:59:28 +11:00
parent a93828a188
commit 03b9d60b8e
3 changed files with 24 additions and 17 deletions

View File

@ -37,7 +37,7 @@ class service_provider implements \core_payment\local\callback\service_provider
* Callback function that returns the enrolment cost and the accountid
* for the course that $instanceid enrolment instance belongs to.
*
* @param string $paymentarea
* @param string $paymentarea Payment area
* @param int $instanceid The enrolment instance id
* @return \core_payment\local\entities\payable
*/

View File

@ -60,9 +60,9 @@ class helper {
/**
* Returns the list of gateways that can process payments in the given currency.
*
* @param string $component
* @param string $paymentarea
* @param int $itemid
* @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea Payment area
* @param int $itemid An identifier that is known to the component
* @return string[]
*/
public static function get_available_gateways(string $component, string $paymentarea, int $itemid): array {
@ -165,7 +165,9 @@ class helper {
}
/**
* @param string $component
* Get the name of the service provider class
*
* @param string $component The component
* @return string
* @throws \coding_exception
*/
@ -185,8 +187,8 @@ class helper {
/**
* Asks the payable from the related component.
*
* @param string $component Name of the component that the itemid belongs to
* @param string $paymentarea
* @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component
* @return local\entities\payable
*/
@ -199,10 +201,10 @@ class helper {
/**
* Returns the gateway configuration for given component and gateway
*
* @param string $component
* @param string $paymentarea
* @param int $itemid
* @param string $gatewayname
* @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea Payment area
* @param int $itemid An identifier that is known to the component
* @param string $gatewayname The gateway name
* @return array
* @throws \moodle_exception
*/
@ -225,8 +227,8 @@ class helper {
*
* @uses \core_payment\local\callback\service_provider::deliver_order()
*
* @param string $component Name of the component that the itemid belongs to
* @param string $paymentarea
* @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component
* @param int $paymentid payment id as inserted into the 'payments' table, if needed for reference
* @param int $userid The userid the order is going to deliver to
@ -244,8 +246,8 @@ class helper {
* Each payment gateway may then store the additional information their way.
*
* @param int $accountid Account id
* @param string $component Name of the component that the itemid belongs to
* @param string $paymentarea
* @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component
* @param int $userid Id of the user who is paying
* @param float $amount Amount of payment

View File

@ -35,14 +35,19 @@ namespace core_payment\local\callback;
interface service_provider {
/**
* @param string $paymentarea
* Callback function that returns the cost of the given item in the specified payment area,
* along with the accountid that payments are paid to.
*
* @param string $paymentarea Payment area
* @param int $itemid An identifier that is known to the plugin
* @return \core_payment\local\entities\payable
*/
public static function get_payable(string $paymentarea, int $itemid): \core_payment\local\entities\payable;
/**
* @param string $paymentarea
* Callback function that delivers what the user paid for to them.
*
* @param string $paymentarea Payment area
* @param int $itemid An identifier that is known to the plugin
* @param int $paymentid payment id as inserted into the 'payments' table, if needed for reference
* @param int $userid The userid the order is going to deliver to