CRM_Core_Payment_PayPalProIPN
in package
Tags
Table of Contents
Properties
- $_component : string
- Component.
- $_inputParameters : array<string|int, mixed>
- Input parameters from payment processor. Store these so that the code does not need to keep retrieving from the http request
- $_invoiceData : array<string|int, mixed>
- Store for the variables from the invoice string.
- $_isPaymentExpress : bool
- Is this a payment express transaction.
- $contributionID : int
- Contribution ID.
- $contributionObject : CRM_Contribute_BAO_Contribution
- Contribution object.
- $contributionRecurID : int|null
- Recurring contribution ID.
- $contributionRecurObject : CRM_Contribute_BAO_ContributionRecur
- Recurring contribution object.
Methods
- __construct() : mixed
- Constructor function.
- getContributionRecurID() : int|null
- Get the recurring contribution ID, if any.
- getInput() : void
- getPayPalPaymentProcessorID() : int
- Gets PaymentProcessorID for PayPal
- getValue() : mixed
- get the values from the rp_invoice_id string.
- handlePaymentExpress() : void
- Handle payment express IPNs.
- main() : void
- This is the main function to call. It should be sufficient to instantiate the class (with the input parameters) & call this & all will be done
- recur() : void
- Process recurring contributions.
- retrieve() : mixed
- setContributionID() : void
- Set contribution ID.
- setContributionRecurID() : void
- setInvoiceData() : mixed
- Set $this->_invoiceData from the input array
- transactionExists() : bool|void
- Function check if transaction already exists.
- getContactID() : int
- Get the relevant contact ID.
- getContributionID() : int
- Get the relevant contribution ID.
- getContributionObject() : CRM_Contribute_BAO_Contribution
- getContributionRecurObject() : CRM_Contribute_BAO_ContributionRecur
- Get the recurring contribution object.
- single() : void
- isContributionCompleted() : bool
- Is the original contribution completed.
- processProfileCreated() : void
- Update a recurring contribution to in progress based on an ipn profile_create notification.
Properties
$_component
Component.
protected
string
$_component
= 'contribute'
Are we dealing with an event an 'anything else' (contribute).
$_inputParameters
Input parameters from payment processor. Store these so that the code does not need to keep retrieving from the http request
protected
array<string|int, mixed>
$_inputParameters
= []
$_invoiceData
Store for the variables from the invoice string.
protected
array<string|int, mixed>
$_invoiceData
= []
$_isPaymentExpress
Is this a payment express transaction.
protected
bool
$_isPaymentExpress
= \FALSE
$contributionID
Contribution ID.
protected
int
$contributionID
$contributionObject
Contribution object.
protected
CRM_Contribute_BAO_Contribution
$contributionObject
$contributionRecurID
Recurring contribution ID.
protected
int|null
$contributionRecurID
$contributionRecurObject
Recurring contribution object.
protected
CRM_Contribute_BAO_ContributionRecur
$contributionRecurObject
Methods
__construct()
Constructor function.
public
__construct(array<string|int, mixed> $inputData) : mixed
Parameters
- $inputData : array<string|int, mixed>
-
Contents of HTTP REQUEST.
Tags
getContributionRecurID()
Get the recurring contribution ID, if any.
public
getContributionRecurID() : int|null
Tags
Return values
int|nullgetInput()
public
getInput(array<string|int, mixed> &$input) : void
Parameters
- $input : array<string|int, mixed>
Tags
getPayPalPaymentProcessorID()
Gets PaymentProcessorID for PayPal
public
getPayPalPaymentProcessorID() : int
Return values
intgetValue()
get the values from the rp_invoice_id string.
public
getValue(string $name[, bool $abort = true ]) : mixed
Parameters
- $name : string
-
E.g. i, values are stored in the string with letter codes.
- $abort : bool = true
-
Throw exception if not found
Tags
handlePaymentExpress()
Handle payment express IPNs.
public
handlePaymentExpress() : void
For one off IPNS no actual response is required Recurring is more difficult as we have limited confirmation material lets look up invoice id in recur_contribution & rely on the unique transaction id to ensure no duplicated this may not be acceptable to all sites - e.g. if they are shipping or delivering something in return then the quasi security of the ids array might be required - although better to http://stackoverflow.com/questions/4848227/validate-that-ipn-call-is-from-paypal but let's assume knowledge on invoice id & schedule is enough for now esp for donations only contribute is handled
Tags
main()
This is the main function to call. It should be sufficient to instantiate the class (with the input parameters) & call this & all will be done
public
main() : void
Tags
recur()
Process recurring contributions.
public
recur(array<string|int, mixed> $input) : void
Parameters
- $input : array<string|int, mixed>
Tags
retrieve()
public
retrieve(string $name, string $type[, bool $abort = true ]) : mixed
Parameters
- $name : string
-
Of variable to return.
- $type : string
-
Data type.
- String
- Integer
- $abort : bool = true
-
Abort if empty.
Tags
setContributionID()
Set contribution ID.
public
setContributionID(int $contributionID) : void
Parameters
- $contributionID : int
setContributionRecurID()
public
setContributionRecurID(int|null $contributionRecurID) : void
Parameters
- $contributionRecurID : int|null
setInvoiceData()
Set $this->_invoiceData from the input array
public
setInvoiceData() : mixed
transactionExists()
Function check if transaction already exists.
public
transactionExists(string $trxn_id) : bool|void
Parameters
- $trxn_id : string
Return values
bool|voidgetContactID()
Get the relevant contact ID.
protected
getContactID() : int
Tags
Return values
intgetContributionID()
Get the relevant contribution ID.
protected
getContributionID() : int
This is the contribution being paid or the original in the recurring series.
Tags
Return values
intgetContributionObject()
protected
getContributionObject() : CRM_Contribute_BAO_Contribution
Tags
Return values
CRM_Contribute_BAO_ContributiongetContributionRecurObject()
Get the recurring contribution object.
protected
getContributionRecurObject() : CRM_Contribute_BAO_ContributionRecur
Tags
Return values
CRM_Contribute_BAO_ContributionRecursingle()
protected
single(array<string|int, mixed> $input) : void
Parameters
- $input : array<string|int, mixed>
Tags
isContributionCompleted()
Is the original contribution completed.
private
isContributionCompleted() : bool
Tags
Return values
boolprocessProfileCreated()
Update a recurring contribution to in progress based on an ipn profile_create notification.
private
processProfileCreated() : void
recurring_payment_profile_created is called when the subscription has been authorized and confirmed by the user, but before a payment has been taken. The recurring_payment_id is POSTed to the IPN and we store it in the recurring contribution's processor_id.