Commit 6c2e042a authored by mattwire's avatar mattwire

Update comments/docblocks

parent 0e51e8bc
......@@ -138,6 +138,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
*
* @param array $params
*
* @throws \CRM_Core_Exception
* @throws \CiviCRM_API3_Exception
*/
protected function updateContributionRefund($params) {
......@@ -170,6 +171,8 @@ trait CRM_Core_Payment_MJWIPNTrait {
* Array of params that are required
* @param array $params
* Array of params to check
*
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
protected function checkRequiredParams($description, $requiredParams, $params) {
foreach ($requiredParams as $required) {
......@@ -184,6 +187,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param array $params
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
protected function updateRecurCancelled($params) {
$this->checkRequiredParams('updateRecurCancelled', ['id'], $params);
......@@ -195,6 +199,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param array $params
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updateRecurSuccess($params) {
$this->checkRequiredParams('updateRecurSuccess', ['id'], $params);
......@@ -210,6 +215,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param array $params
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updateRecurCompleted($params) {
$this->checkRequiredParams('updateRecurCompleted', ['id'], $params);
......@@ -223,6 +229,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param array $params
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updateRecurFailed($params) {
$this->checkRequiredParams('updateRecurFailed', ['id'], $params);
......@@ -243,7 +250,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
/**
* Repeat a contribution (call the Contribution.repeattransaction API)
*
* @param string $status
* @param array $params
*
* @throws \CiviCRM_API3_Exception
*/
......@@ -259,7 +266,10 @@ trait CRM_Core_Payment_MJWIPNTrait {
/**
* Complete a pending contribution and update associated entities (recur/membership)
*
* @param array $params
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updateContributionCompleted($params) {
$this->checkRequiredParams('updateContributionCompleted', ['id', 'trxn_date', 'contribution_trxn_id', 'payment_trxn_id'], $params);
......@@ -276,6 +286,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param array $params ['id', 'receive_date'{, cancel_date, cancel_reason}]
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updateContributionFailed($params) {
$this->checkRequiredParams('updateContributionFailed', ['id', 'receive_date', 'payment_trxn_id'], $params);
......@@ -295,6 +306,7 @@ trait CRM_Core_Payment_MJWIPNTrait {
* @param string $orderReference
*
* @throws \CiviCRM_API3_Exception
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
private function updatePaymentTrxnID($contributionID, $trxnID, $orderReference = '') {
// @fixme: There needs to be a better way to do this!!
......@@ -331,6 +343,8 @@ trait CRM_Core_Payment_MJWIPNTrait {
* Log and throw an IPN exception
*
* @param string $message
*
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
protected function exception($message) {
$errorMessage = $this->_paymentProcessor->getPaymentProcessorLabel() . ' Exception: Event: ' . $this->event_type . ' Error: ' . $message;
......@@ -339,7 +353,8 @@ trait CRM_Core_Payment_MJWIPNTrait {
http_response_code(400);
exit(1);
} else {
throw new Exception($message);
Throw new \Civi\Payment\Exception\PaymentProcessorException($message);
}
}
}
......@@ -34,7 +34,7 @@ class CRM_Mjwshared_Resources extends CRM_Core_Resources {
* Usually the name of your extension.
* @param array $vars
* @param string $region
* The region to add settings to (eg. for payment processors usually billing-block
* The region to add settings to (eg. for payment processors usually billing-block)
*
* @return CRM_Core_Resources
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment