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 af0040445a
commit e37e06d194
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 * Callback function that returns the enrolment cost and the accountid
* for the course that $instanceid enrolment instance belongs to. * for the course that $instanceid enrolment instance belongs to.
* *
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $instanceid The enrolment instance id * @param int $instanceid The enrolment instance id
* @return \core_payment\local\entities\payable * @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. * Returns the list of gateways that can process payments in the given currency.
* *
* @param string $component * @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $itemid * @param int $itemid An identifier that is known to the component
* @return string[] * @return string[]
*/ */
public static function get_available_gateways(string $component, string $paymentarea, int $itemid): array { 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 * @return string
* @throws \coding_exception * @throws \coding_exception
*/ */
@ -185,8 +187,8 @@ class helper {
/** /**
* Asks the payable from the related component. * Asks the payable from the related component.
* *
* @param string $component Name of the component that the itemid belongs to * @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component * @param int $itemid An internal identifier that is used by the component
* @return local\entities\payable * @return local\entities\payable
*/ */
@ -199,10 +201,10 @@ class helper {
/** /**
* Returns the gateway configuration for given component and gateway * Returns the gateway configuration for given component and gateway
* *
* @param string $component * @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $itemid * @param int $itemid An identifier that is known to the component
* @param string $gatewayname * @param string $gatewayname The gateway name
* @return array * @return array
* @throws \moodle_exception * @throws \moodle_exception
*/ */
@ -225,8 +227,8 @@ class helper {
* *
* @uses \core_payment\local\callback\service_provider::deliver_order() * @uses \core_payment\local\callback\service_provider::deliver_order()
* *
* @param string $component Name of the component that the itemid belongs to * @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component * @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 $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 * @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. * Each payment gateway may then store the additional information their way.
* *
* @param int $accountid Account id * @param int $accountid Account id
* @param string $component Name of the component that the itemid belongs to * @param string $component Name of the component that the paymentarea and itemid belong to
* @param string $paymentarea * @param string $paymentarea Payment area
* @param int $itemid An internal identifier that is used by the component * @param int $itemid An internal identifier that is used by the component
* @param int $userid Id of the user who is paying * @param int $userid Id of the user who is paying
* @param float $amount Amount of payment * @param float $amount Amount of payment

View file

@ -35,14 +35,19 @@ namespace core_payment\local\callback;
interface service_provider { 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 * @param int $itemid An identifier that is known to the plugin
* @return \core_payment\local\entities\payable * @return \core_payment\local\entities\payable
*/ */
public static function get_payable(string $paymentarea, int $itemid): \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 $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 $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 * @param int $userid The userid the order is going to deliver to