class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment

Class CRM_Core_Payment_PayPalImpl for paypal pro, paypal standard & paypal express.

Constants

BILLING_MODE_FORM

How are we getting billing information.

We are trying to completely deprecate these parameters.

FORM - we collect it on the same page BUTTON - the processor collects it and sends it back to us via some protocol

BILLING_MODE_BUTTON

How are we getting billing information.

We are trying to completely deprecate these parameters.

FORM - we collect it on the same page BUTTON - the processor collects it and sends it back to us via some protocol

BILLING_MODE_NOTIFY

How are we getting billing information.

We are trying to completely deprecate these parameters.

FORM - we collect it on the same page BUTTON - the processor collects it and sends it back to us via some protocol

PAYMENT_TYPE_CREDIT_CARD

Which payment type(s) are we using?

credit card direct debit or both

PAYMENT_TYPE_DIRECT_DEBIT

Which payment type(s) are we using?

credit card direct debit or both

RECURRING_PAYMENT_START

Subscription / Recurring payment Status START, END

RECURRING_PAYMENT_END

Subscription / Recurring payment Status START, END

CHARSET

PAYPAL_PRO

PAYPAL_STANDARD

PAYPAL_EXPRESS

Properties

protected string $_component Component - ie. event or contribute. from CRM_Core_Payment
protected array $_paymentProcessor from CRM_Core_Payment
protected string $baseReturnUrl Base url of the calling form (offsite processors). from CRM_Core_Payment
protected string $successUrl Return url upon success (offsite processors). from CRM_Core_Payment
protected string $cancelUrl Return url upon failure (offsite processors). from CRM_Core_Payment
string $_processorName Processor type label. from CRM_Core_Payment
protected int|string $billingProfile The profile configured to show on the billing form. from CRM_Core_Payment
protected int $paymentInstrumentID Payment instrument ID. from CRM_Core_Payment
protected bool $backOffice Is this a back office transaction. from CRM_Core_Payment
protected $_mode

Methods

bool
isBackOffice()

No description

setBackOffice(bool $isBackOffice)

Set back office property.

int
getPaymentInstrumentID()

Get payment instrument id.

int
getID()

Getter for the id.

setPaymentInstrumentID(int $paymentInstrumentID)

Set payment Instrument id.

setBaseReturnUrl(string $url)

Set base return path (offsite processors).

setSuccessUrl(string $url)

Set success return URL (offsite processors).

setCancelUrl(string $url)

Set cancel return URL (offsite processors).

setBillingProfile(int|string $value)

Set the configured payment profile.

bool
buildForm(CRM_Core_Form $form)

Opportunity for the payment processor to override the entire form build.

static 
logPaymentNotification(array $params)

Log payment notification message to forensic system log.

bool
supports(string $capability)

Check if capability is supported.

bool
supportsBackOffice()

Are back office payments supported.

bool
supportsMultipleConcurrentPayments()

Can more than one transaction be processed at once?

bool
supportsLiveMode()

Are live payments supported - e.g dummy doesn't support this.

bool
supportsTestMode()

Are test payments supported.

bool
supportsRefund()

Does this payment processor support refund?

bool
supportsFutureRecurStartDate()

Should the first payment date be configurable when setting up back office recurring payments.

bool
supportsCancelRecurring()

Does this processor support cancelling recurring contributions through code.

bool
supportsPreApproval()

Does this processor support pre-approval.

bool
supportsUpdateSubscriptionBillingInfo()

Does this processor support updating billing info for recurring contributions through code.

bool
supportsRecurContributionsForPledges()

Can recurring contributions be set against pledges.

doPreApproval(array $params)

Function to action pre-approval if supported

array
getPreApprovalDetails(array $storedDetails)

Get any details that may be available to the payment processor due to an approval process having happened.

validatePaymentInstrument(array $values, array $errors)

Default payment instrument validation.

array
getPaymentProcessor()

Getter for the payment processor.

setPaymentProcessor(array $processor)

Setter for the payment processor.

setForm(CRM_Core_Form $paymentForm) deprecated

Setter for the payment form that wants to use the processor.

getForm() deprecated

Getter for payment form that is using the processor.

string
getText(string $context, array $params)

Get help text information (help, description, etc.) about this payment, to display to the user.

null
getVar(string $name)

Getter for accessing member vars.

string
getPaymentTypeName()

Get name for the payment information type.

string
getPaymentTypeLabel()

Get label for the payment information type.

array
getPaymentFormFields()

Get array of fields that should be displayed on the payment form.

array
getEditableRecurringScheduleFields()

Get an array of the fields that can be edited on the recurring contribution.

string
getRecurringScheduleUpdateHelpText()

Get the help text to present on the recurring update page.

array;
getMandatoryFields()

Get the metadata for all required fields.

array
getAllFields()

Get the metadata of all the fields configured for this processor.

array
getCreditCardFormFields()

Get array of fields that should be displayed on the payment form for credit cards.

array
getDirectDebitFormFields()

Get array of fields that should be displayed on the payment form for direct debits.

array
getPaymentFormFieldsMetadata()

Return an array of all the details about the fields potentially required for payment fields.

array
getBillingAddressFields(int $billingLocationID = NULL)

Get billing fields required for this processor.

array
getBillingAddressFieldsMetadata(int $billingLocationID = NULL)

Get form metadata for billing address fields.

string
getBaseReturnUrl()

Get base url dependent on component.

string
getCurrency($params)

Get the currency for the transaction.

string
getAmount($params)

Get the currency for the transaction.

string
getCancelUrl(string $qfKey, int $participantID)

Get url to return to after cancelled or failed transaction.

string
getReturnSuccessUrl($qfKey)

Get URL to return the browser to on success.

string
getReturnFailUrl(string $key, int $participantID = NULL, int $eventID = NULL)

Get URL to return the browser to on failure.

string
getGoBackUrl($qfKey)

Get URl for when the back button is pressed.

string
getNotifyUrl()

Get the notify (aka ipn, web hook or silent post) url.

array
doDirectPayment(array $params, string $component = 'contribute')

This function collects all the information from a web/api form and invokes the relevant payment processor specific functions to perform the transaction

array
doPayment(array $params, string $component = 'contribute')

Process payment - this function wraps around both doTransferCheckout and doDirectPayment.

doRefund(array $params)

Refunds payment

array
doQuery(array $params)

Query payment processor for details about a transaction.

string
checkConfig()

This function checks to see if we have the right config values.

static bool
paypalRedirect($paymentProcessor)

Redirect for paypal.

static 
handleIPN()

Handle incoming payment notification.

static 
handlePaymentMethod(string $method, array $params = [])

Payment callback handler.

bool
isSupported(string $method)

Check whether a method is present ( & supported ) by the payment processor object.

isSuppressSubmitButtons()

Paypal express replaces the submit button with it's own.

bool
checkDupe(int $invoiceId, null $contributionID = NULL)

Checks to see if invoice_id already exists in db.

string
subscriptionURL(int $entityID = NULL, null $entity = NULL, string $action = 'cancel')

Get url for users to manage this recurring contribution for this processor.

string
getPaymentDescription(array $params, int $length = 24)

Get description of payment to pass to processor.

bool
supportsEditRecurringContribution()

Checks if backoffice recurring edit is allowed

bool
supportsChangeSubscriptionAmount()

Does this processor support changing the amount for recurring contributions through code.

bool
supportsRecurring()

Checks if payment processor supports recurring contributions

bool
supportsAccountLoginURL()

Checks if payment processor supports an account login URL TODO: This is checked by self::subscriptionURL but is only used if no entityID is found.

isSendReceiptForPending()

Should a receipt be sent out for a pending payment.

__construct(string $mode, CRM_Core_Payment $paymentProcessor)

Constructor.

bool
isPayPalType($typeName)

Helper function to check which payment processor type is being used.

addPaypalExpressCode(CRM_Core_Form $form)

Billing mode button is basically synonymous with paypal express.

array
setExpressCheckOut(array $params)

Express checkout code.

array
getExpressCheckoutDetails(string $token)

Get details from paypal.

array
doExpressCheckout(array $params)

Do the express checkout at paypal.

mixed
createRecurringPayments(array $params)

Create recurring payments.

initialize($args, $method)

Initialise.

null|string
cancelSubscriptionURL()

No description

array|bool|object
cancelSubscription(string $message = '', array $params = [])

No description

static 
handlePaymentNotification()

Process incoming notification.

array|bool|object
updateSubscriptionBillingInfo(string $message = '', array $params = [])

No description

array|bool|object
changeSubscriptionAmount(string $message = '', array $params = [])

No description

doTransferCheckout(array $params, string $component = 'contribute')

No description

array|object
invokeAPI(array $args, null $url = NULL)

Hash_call: Function to perform the API call to PayPal using API signature.

static array
deformat(string $str)

This function will take NVPString and convert it to an Associative Array.

array
mapPaypalParamsToCivicrmParams(array $fieldMap, array $paypalParams)

Map the paypal params to CiviCRM params using a field map.

bool
isPaypalExpress(array $params)

Is this being processed by payment express.

Details

in CRM_Core_Payment at line 155
bool isBackOffice()

Return Value

bool

in CRM_Core_Payment at line 164
setBackOffice(bool $isBackOffice)

Set back office property.

Parameters

bool $isBackOffice

in CRM_Core_Payment at line 173
int getPaymentInstrumentID()

Get payment instrument id.

Return Value

int

in CRM_Core_Payment at line 182
int getID()

Getter for the id.

Return Value

int

in CRM_Core_Payment at line 193
setPaymentInstrumentID(int $paymentInstrumentID)

Set payment Instrument id.

By default we actually ignore the form value. The manual processor takes it more seriously.

Parameters

int $paymentInstrumentID

in CRM_Core_Payment at line 205
setBaseReturnUrl(string $url)

Set base return path (offsite processors).

This is only useful with an internal civicrm form.

Parameters

string $url Internal civicrm path.

in CRM_Core_Payment at line 217
setSuccessUrl(string $url)

Set success return URL (offsite processors).

This overrides $baseReturnUrl

Parameters

string $url Full url of site to return browser to upon success.

in CRM_Core_Payment at line 229
setCancelUrl(string $url)

Set cancel return URL (offsite processors).

This overrides $baseReturnUrl

Parameters

string $url Full url of site to return browser to upon failure.

in CRM_Core_Payment at line 238
setBillingProfile(int|string $value)

Set the configured payment profile.

Parameters

int|string $value

at line 147
bool buildForm(CRM_Core_Form $form)

Opportunity for the payment processor to override the entire form build.

Parameters

CRM_Core_Form $form

Return Value

bool Should form building stop at this point?

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 261
static logPaymentNotification(array $params)

Log payment notification message to forensic system log.

Parameters

array $params

in CRM_Core_Payment at line 293
bool supports(string $capability)

Check if capability is supported.

Capabilities have a one to one relationship with capability-related functions on this class.

Payment processor classes should over-ride the capability-specific function rather than this one.

Parameters

string $capability E.g BackOffice, LiveMode, FutureRecurStartDate.

Return Value

bool

at line 112
protected bool supportsBackOffice()

Are back office payments supported.

E.g paypal standard won't permit you to enter a credit card associated with someone else's login.

Return Value

bool

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 329
protected bool supportsMultipleConcurrentPayments()

Can more than one transaction be processed at once?

In general processors that process payment by server to server communication support this while others do not.

In future we are likely to hit an issue where this depends on whether a token already exists.

Return Value

bool

in CRM_Core_Payment at line 343
protected bool supportsLiveMode()

Are live payments supported - e.g dummy doesn't support this.

Return Value

bool

in CRM_Core_Payment at line 352
protected bool supportsTestMode()

Are test payments supported.

Return Value

bool

in CRM_Core_Payment at line 361
bool supportsRefund()

Does this payment processor support refund?

Return Value

bool

in CRM_Core_Payment at line 372
protected bool supportsFutureRecurStartDate()

Should the first payment date be configurable when setting up back office recurring payments.

We set this to false for historical consistency but in fact most new processors use tokens for recurring and can support this

Return Value

bool

in CRM_Core_Payment at line 385
protected bool supportsCancelRecurring()

Does this processor support cancelling recurring contributions through code.

If the processor returns true it must be possible to take action from within CiviCRM that will result in no further payments being processed. In the case of token processors (e.g IATS, eWay) updating the contribution_recur table is probably sufficient.

Return Value

bool

at line 131
protected bool supportsPreApproval()

Does this processor support pre-approval.

This would generally look like a redirect to enter credentials which can then be used in a later payment call.

Currently Paypal express supports this, with a redirect to paypal after the 'Main' form is submitted in the contribution page. This token can then be processed at the confirm phase. Although this flow 'looks' like the 'notify' flow a key difference is that in the notify flow they don't have to return but in this flow they do.

Return Value

bool

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 412
protected bool supportsUpdateSubscriptionBillingInfo()

Does this processor support updating billing info for recurring contributions through code.

If the processor returns true then it must be possible to update billing info from within CiviCRM that will be updated at the payment processor.

Return Value

bool

at line 213
protected bool supportsRecurContributionsForPledges()

Can recurring contributions be set against pledges.

In practice all processors that use the baseIPN function to finish transactions or call the completetransaction api support this by looking up previous contributions in the series and, if there is a prior contribution against a pledge, and the pledge is not complete, adding the new payment to the pledge.

However, only enabling for processors it has been tested against.

Return Value

bool

at line 860
doPreApproval(array $params)

Function to action pre-approval if supported

Parameters

array $params Parameters from the form

This function returns an array which should contain - pre_approval_parameters (this will be stored on the calling form & available later) - redirect_url (if set the browser will be redirected to this.

Exceptions

PaymentProcessorException

at line 294
array getPreApprovalDetails(array $storedDetails)

Get any details that may be available to the payment processor due to an approval process having happened.

In some cases the browser is redirected to enter details on a processor site. Some details may be available as a result.

Parameters

array $storedDetails

Return Value

array

Exceptions

PaymentProcessorException

at line 228
validatePaymentInstrument(array $values, array $errors)

Default payment instrument validation.

Implement the usual Luhn algorithm via a static function in the CRM_Core_Payment_Form if it's a credit card Not a static function, because I need to check for payment_type.

Parameters

array $values
array $errors

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 483
array getPaymentProcessor()

Getter for the payment processor.

The payment processor array is based on the civicrm_payment_processor table entry.

Return Value

array Payment processor array.

in CRM_Core_Payment at line 492
setPaymentProcessor(array $processor)

Setter for the payment processor.

Parameters

array $processor

in CRM_Core_Payment at line 503
setForm(CRM_Core_Form $paymentForm) deprecated

deprecated

Setter for the payment form that wants to use the processor.

Parameters

CRM_Core_Form $paymentForm

in CRM_Core_Payment at line 513
CRM_Core_Form getForm() deprecated

deprecated

Getter for payment form that is using the processor.

Return Value

CRM_Core_Form A form object

in CRM_Core_Payment at line 532
string getText(string $context, array $params)

Get help text information (help, description, etc.) about this payment, to display to the user.

Parameters

string $context Context of the text. Only explicitly supported contexts are handled without error. Currently supported: - contributionPageRecurringHelp (params: is_recur_installments, is_email_receipt)
array $params Parameters for the field, context specific.

Return Value

string

in CRM_Core_Payment at line 579
null getVar(string $name)

Getter for accessing member vars.

Parameters

string $name

Return Value

null

in CRM_Core_Payment at line 588
string getPaymentTypeName()

Get name for the payment information type.

Return Value

string

in CRM_Core_Payment at line 597
string getPaymentTypeLabel()

Get label for the payment information type.

Return Value

string

at line 1138
array getPaymentFormFields()

Get array of fields that should be displayed on the payment form.

Return Value

array Array of payment fields appropriate to the payment processor.

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 648
array getEditableRecurringScheduleFields()

Get an array of the fields that can be edited on the recurring contribution.

Some payment processors support editing the amount and other scheduling details of recurring payments, especially those which use tokens. Others are fixed. This function allows the processor to return an array of the fields that can be updated from the contribution recur edit screen.

The fields are likely to be a subset of these - 'amount', - 'installments', - 'frequency_interval', - 'frequency_unit', - 'cycle_day', - 'next_sched_contribution_date', - 'end_date', - 'failure_retry_day',

The form does not restrict which fields from the contribution_recur table can be added (although if the html_type metadata is not defined in the xml for the field it will cause an error.

Open question - would it make sense to return membership_id in this - which is sometimes editable and is on that form (UpdateSubscription).

Return Value

array

in CRM_Core_Payment at line 662
string getRecurringScheduleUpdateHelpText()

Get the help text to present on the recurring update page.

This should reflect what can or cannot be edited.

Return Value

string

in CRM_Core_Payment at line 674
protected array; getMandatoryFields()

Get the metadata for all required fields.

Return Value

array;

in CRM_Core_Payment at line 689
protected array getAllFields()

Get the metadata of all the fields configured for this processor.

Return Value

array

in CRM_Core_Payment at line 700
protected array getCreditCardFormFields()

Get array of fields that should be displayed on the payment form for credit cards.

Return Value

array

in CRM_Core_Payment at line 714
protected array getDirectDebitFormFields()

Get array of fields that should be displayed on the payment form for direct debits.

Return Value

array

in CRM_Core_Payment at line 731
array getPaymentFormFieldsMetadata()

Return an array of all the details about the fields potentially required for payment fields.

Only those determined by getPaymentFormFields will actually be assigned to the form

Return Value

array field metadata

in CRM_Core_Payment at line 903
array getBillingAddressFields(int $billingLocationID = NULL)

Get billing fields required for this processor.

We apply the existing default of returning fields only for payment processor type 1. Processors can override to alter.

Parameters

int $billingLocationID

Return Value

array

in CRM_Core_Payment at line 933
array getBillingAddressFieldsMetadata(int $billingLocationID = NULL)

Get form metadata for billing address fields.

Parameters

int $billingLocationID

Return Value

array Array of metadata for address fields.

in CRM_Core_Payment at line 1047
protected string getBaseReturnUrl()

Get base url dependent on component.

(or preferably set it using the setter function).

Return Value

string

in CRM_Core_Payment at line 1069
protected string getCurrency($params)

Get the currency for the transaction.

Handle any inconsistency about how it is passed in here.

Parameters

$params

Return Value

string

in CRM_Core_Payment at line 1082
protected string getAmount($params)

Get the currency for the transaction.

Handle any inconsistency about how it is passed in here.

Parameters

$params

Return Value

string

in CRM_Core_Payment at line 1094
string getCancelUrl(string $qfKey, int $participantID)

Get url to return to after cancelled or failed transaction.

Parameters

string $qfKey
int $participantID

Return Value

string cancel url

in CRM_Core_Payment at line 1125
protected string getReturnSuccessUrl($qfKey)

Get URL to return the browser to on success.

Parameters

$qfKey

Return Value

string

in CRM_Core_Payment at line 1148
protected string getReturnFailUrl(string $key, int $participantID = NULL, int $eventID = NULL)

Get URL to return the browser to on failure.

Parameters

string $key
int $participantID
int $eventID

Return Value

string URL for a failing transactor to be redirected to.

in CRM_Core_Payment at line 1175
protected string getGoBackUrl($qfKey)

Get URl for when the back button is pressed.

Parameters

$qfKey

Return Value

string url

in CRM_Core_Payment at line 1193
protected string getNotifyUrl()

Get the notify (aka ipn, web hook or silent post) url.

If there is no '.' in it we assume that we are dealing with localhost or similar and it is unreachable from the web & hence invalid.

Return Value

string URL to notify outcome of transaction.

at line 524
array doDirectPayment(array $params, string $component = 'contribute')

This function collects all the information from a web/api form and invokes the relevant payment processor specific functions to perform the transaction

Parameters

array $params Assoc array of input parameters for this transaction.
string $component

Return Value

array the result in an nice formatted array (or an error object - but throwing exceptions is preferred)

Exceptions

PaymentProcessorException

at line 503
array doPayment(array $params, string $component = 'contribute')

Process payment - this function wraps around both doTransferCheckout and doDirectPayment.

The function ensures an exception is thrown & moves some of this logic out of the form layer and makes the forms more agnostic.

Payment processors should set payment_status_id. This function adds some historical defaults ie. the assumption that if a 'doDirectPayment' processors comes back it completed the transaction & in fact doTransferCheckout would not traditionally come back.

doDirectPayment does not do an immediate payment for Authorize.net or Paypal so the default is assumed to be Pending.

Once this function is fully rolled out then it will be preferred for processors to throw exceptions than to return Error objects

Parameters

array $params
string $component

Return Value

array Result array (containing at least the key payment_status_id)

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 1289
doRefund(array $params)

Refunds payment

Payment processors should set payment_status_id if it set the status to Refunded in case the transaction is successful

Parameters

array $params

Exceptions

PaymentProcessorException

at line 617
array doQuery(array $params)

Query payment processor for details about a transaction.

For paypal see : https://developer.paypal.com/webapps/developer/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/

Parameters

array $params Array of parameters containing one of: - trxn_id Id of an individual transaction. - processor_id Id of a recurring contribution series as stored in the civicrm_contribution_recur table.

Return Value

array Extra parameters retrieved. Any parameters retrievable through this should be documented in the function comments at CRM_Core_Payment::doQuery. Currently: - fee_amount Amount of fee paid

Exceptions

PaymentProcessorException

at line 643
string checkConfig()

This function checks to see if we have the right config values.

Return Value

string the error message if any

Exceptions

PaymentProcessorException

in CRM_Core_Payment at line 1326
static bool paypalRedirect($paymentProcessor)

Redirect for paypal.

Parameters

$paymentProcessor

Return Value

bool

in CRM_Core_Payment at line 1350
static handleIPN()

Handle incoming payment notification.

IPNs, also called silent posts are notifications of payment outcomes or activity on an external site.

in CRM_Core_Payment at line 1388
static handlePaymentMethod(string $method, array $params = [])

Payment callback handler.

The processor_name or processor_id is passed in. Note that processor_id is more reliable as one site may have more than one instance of a processor & ideally the processor will be validating the results Load requested payment processor and call that processor's handle<$method> method

Parameters

string $method 'PaymentNotification' or 'PaymentCron'
array $params

Exceptions

CRM_Core_Exception
Exception

at line 689
bool isSupported(string $method)

Check whether a method is present ( & supported ) by the payment processor object.

Parameters

string $method Method to check for.

Return Value

bool

Exceptions

PaymentProcessorException

at line 705
isSuppressSubmitButtons()

Paypal express replaces the submit button with it's own.

in CRM_Core_Payment at line 1519
protected bool checkDupe(int $invoiceId, null $contributionID = NULL)

Checks to see if invoice_id already exists in db.

It's arguable if this belongs in the payment subsystem at all but since several processors implement it it is better to standardise to being here.

Parameters

int $invoiceId The ID to check.
null $contributionID If a contribution exists pass in the contribution ID.

Return Value

bool True if invoice ID otherwise exists, else false

in CRM_Core_Payment at line 1537
string subscriptionURL(int $entityID = NULL, null $entity = NULL, string $action = 'cancel')

Get url for users to manage this recurring contribution for this processor.

Parameters

int $entityID
null $entity
string $action

Return Value

string

in CRM_Core_Payment at line 1630
protected string getPaymentDescription(array $params, int $length = 24)

Get description of payment to pass to processor.

This is often what people see in the interface so we want to get as much unique information in as possible within the field length (& presumably the early part of the field)

People seeing these can be assumed to be advanced users so quantity of information probably trumps having field names to clarify

Parameters

array $params
int $length

Return Value

string

in CRM_Core_Payment at line 1659
bool supportsEditRecurringContribution()

Checks if backoffice recurring edit is allowed

Return Value

bool

in CRM_Core_Payment at line 1671
protected bool supportsChangeSubscriptionAmount()

Does this processor support changing the amount for recurring contributions through code.

If the processor returns true then it must be possible to update the amount from within CiviCRM that will be updated at the payment processor.

Return Value

bool

in CRM_Core_Payment at line 1680
bool supportsRecurring()

Checks if payment processor supports recurring contributions

Return Value

bool

in CRM_Core_Payment at line 1694
protected bool supportsAccountLoginURL()

Checks if payment processor supports an account login URL TODO: This is checked by self::subscriptionURL but is only used if no entityID is found.

TODO: It is implemented by AuthorizeNET, any others?

Return Value

bool

in CRM_Core_Payment at line 1703
isSendReceiptForPending()

Should a receipt be sent out for a pending payment.

e.g for traditional pay later & ones with a delayed settlement a pending receipt makes sense.

at line 59
CRM_Core_Payment_PayPalImpl __construct(string $mode, CRM_Core_Payment $paymentProcessor)

Constructor.

Parameters

string $mode The mode of operation: live or test.
CRM_Core_Payment $paymentProcessor

Return Value

CRM_Core_Payment_PayPalImpl

Exceptions

PaymentProcessorException

at line 85
bool isPayPalType($typeName)

Helper function to check which payment processor type is being used.

Parameters

$typeName

Return Value

bool

Exceptions

PaymentProcessorException

at line 175
protected addPaypalExpressCode(CRM_Core_Form $form)

Billing mode button is basically synonymous with paypal express.

This is probably a good example of 'odds & sods' code we need to find a way for the payment processor to assign.

A tricky aspect is that the payment processor may need to set the order

Parameters

CRM_Core_Form $form

at line 247
protected array setExpressCheckOut(array $params)

Express checkout code.

Check PayPal documentation for more information

Parameters

array $params Assoc array of input parameters for this transaction.

Return Value

array the result in an nice formatted array (or an error object)

Exceptions

PaymentProcessorException

at line 310
array getExpressCheckoutDetails(string $token)

Get details from paypal.

Check PayPal documentation for more information

Parameters

string $token The key associated with this transaction.

Return Value

array the result in an nice formatted array (or an error object)

Exceptions

PaymentProcessorException

at line 354
array doExpressCheckout(array $params)

Do the express checkout at paypal.

Check PayPal documentation for more information

Parameters

array $params

Return Value

array The result in an nice formatted array.

Exceptions

PaymentProcessorException

at line 411
mixed createRecurringPayments(array $params)

Create recurring payments.

Use a pre-authorisation token to activate a recurring payment profile https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/

Parameters

array $params

Return Value

mixed

Exceptions

Exception

at line 469
initialize($args, $method)

Initialise.

Parameters

$args
$method

at line 671
null|string cancelSubscriptionURL()

Return Value

null|string

Exceptions

PaymentProcessorException

at line 719
array|bool|object cancelSubscription(string $message = '', array $params = [])

Parameters

string $message
array $params

Return Value

array|bool|object

Exceptions

PaymentProcessorException

at line 744
static handlePaymentNotification()

Process incoming notification.

at line 788
array|bool|object updateSubscriptionBillingInfo(string $message = '', array $params = [])

Parameters

string $message
array $params

Return Value

array|bool|object

Exceptions

PaymentProcessorException

at line 827
array|bool|object changeSubscriptionAmount(string $message = '', array $params = [])

Parameters

string $message
array $params

Return Value

array|bool|object

Exceptions

PaymentProcessorException

at line 878
doTransferCheckout(array $params, string $component = 'contribute')

Parameters

array $params
string $component

Exceptions

Exception

at line 1036
array|object invokeAPI(array $args, null $url = NULL)

Hash_call: Function to perform the API call to PayPal using API signature.

Parameters

array $args
null $url

Return Value

array|object

Exceptions

Exception

at line 1109
static array deformat(string $str)

This function will take NVPString and convert it to an Associative Array.

It will decode the response. It is useful to search for a particular key and displaying arrays.

Parameters

string $str

Return Value

array

at line 1155
protected array mapPaypalParamsToCivicrmParams(array $fieldMap, array $paypalParams)

Map the paypal params to CiviCRM params using a field map.

Parameters

array $fieldMap
array $paypalParams

Return Value

array

at line 1173
protected bool isPaypalExpress(array $params)

Is this being processed by payment express.

Either because it is payment express or because is pro with paypal express in use.

Parameters

array $params

Return Value

bool

Exceptions

PaymentProcessorException