MediaWiki fundraising/REL1_35
PaymentResult Class Reference

Contains donation workflow UI hints. More...

Public Member Functions

 getErrors ()
 
 getFormData ()
 
 getIframe ()
 
 getRedirect ()
 
 getRefresh ()
 
 isFailed ()
 

Static Public Member Functions

static fromResults (PaymentTransactionResponse $response, $finalStatus)
 Build a PaymentResult object from adapter results.
 
static newEmpty ()
 
static newFailure ( $errors=[])
 
static newFailureAndRedirect ( $url, $errors=[])
 
static newIframe ( $url, $formData=[])
 
static newRedirect ( $url, $formData=[])
 
static newRefresh ( $errors=[])
 
static newSuccess ()
 

Protected Member Functions

 __construct ()
 

Protected Attributes

 $errors = []
 
 $failed = false
 
 $formData = []
 
 $iframe
 
 $redirect
 
 $refresh = false
 

Detailed Description

Contains donation workflow UI hints.

After each donation request or gateway response, the adapter produces a PaymentResult which wraps one of the following:

  • Success: Send donor to the Thank You page.
  • Failure (unrecoverable): Send donor to the failure page.
  • Refresh form: After validation or other recoverable errors, display the donation form again and give the donor a chance to correct any errors, usually with helpful notices. This PaymentResult object will contain a map of field names to errors. If we're feel really feisty, we can make the form name dynamic, as well as other parameters to the view template–so one form may send the donor to a more appropriate form.
  • Iframe: FIXME, this is almost a variation on refreshForm.
  • Gateway redirect: Send donor to the gateway, usually with a ton of data in the URL's GET params.

Definition at line 30 of file PaymentResult.php.

Constructor & Destructor Documentation

◆ __construct()

PaymentResult::__construct ( )
protected

Definition at line 38 of file PaymentResult.php.

Member Function Documentation

◆ fromResults()

◆ getErrors()

PaymentResult::getErrors ( )

Definition at line 108 of file PaymentResult.php.

References $errors.

Referenced by GatewayPage\renderResponse().

◆ getFormData()

PaymentResult::getFormData ( )

Definition at line 96 of file PaymentResult.php.

References $formData.

◆ getIframe()

PaymentResult::getIframe ( )

Definition at line 92 of file PaymentResult.php.

References $iframe.

Referenced by GatewayPage\renderResponse().

◆ getRedirect()

PaymentResult::getRedirect ( )

Definition at line 100 of file PaymentResult.php.

References $redirect.

Referenced by DonationApi\markLiberatedOnRedirect(), and GatewayPage\renderResponse().

◆ getRefresh()

PaymentResult::getRefresh ( )

Definition at line 104 of file PaymentResult.php.

References $refresh.

◆ isFailed()

PaymentResult::isFailed ( )

Definition at line 112 of file PaymentResult.php.

References $failed.

Referenced by GatewayPage\renderResponse().

◆ newEmpty()

static PaymentResult::newEmpty ( )
static

Definition at line 83 of file PaymentResult.php.

Referenced by fromResults(), and GatewayAdapter\rectifyOrphan().

◆ newFailure()

◆ newFailureAndRedirect()

static PaymentResult::newFailureAndRedirect ( $url,
$errors = [] )
static

Definition at line 74 of file PaymentResult.php.

References $errors.

◆ newIframe()

static PaymentResult::newIframe ( $url,
$formData = [] )
static

Definition at line 41 of file PaymentResult.php.

References $formData.

Referenced by GlobalCollectAdapter\doPayment(), and IngenicoAdapter\doPayment().

◆ newRedirect()

static PaymentResult::newRedirect ( $url,
$formData = [] )
static

◆ newRefresh()

static PaymentResult::newRefresh ( $errors = [])
static

Definition at line 55 of file PaymentResult.php.

References $errors.

Referenced by fromResults().

◆ newSuccess()

Member Data Documentation

◆ $errors

PaymentResult::$errors = []
protected

Definition at line 34 of file PaymentResult.php.

Referenced by getErrors(), newFailure(), newFailureAndRedirect(), and newRefresh().

◆ $failed

PaymentResult::$failed = false
protected

Definition at line 36 of file PaymentResult.php.

Referenced by isFailed().

◆ $formData

PaymentResult::$formData = []
protected

Definition at line 35 of file PaymentResult.php.

Referenced by getFormData(), newIframe(), and newRedirect().

◆ $iframe

PaymentResult::$iframe
protected

Definition at line 31 of file PaymentResult.php.

Referenced by getIframe().

◆ $redirect

PaymentResult::$redirect
protected

Definition at line 32 of file PaymentResult.php.

Referenced by getRedirect().

◆ $refresh

PaymentResult::$refresh = false
protected

Definition at line 33 of file PaymentResult.php.

Referenced by getRefresh().


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