Skip to content

Commit

Permalink
adding extractCustomPropertiesForDoPayment() method proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Lott / Artful Robot committed Nov 26, 2019
1 parent 47c9685 commit 4fbf25a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CRM/Core/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,23 @@ protected function doDirectPayment(&$params) {
return $params;
}

/**
* Processors may need to inspect, validate, cast and copy data that is
* specific to this Payment Processor from the input array to custom fields
* on the PropertyBag.
*
* @param PropertyBag $propertyBag
* @param array $params
* @param string $component
*
* @throws \Civi\Payment\Exception\PaymentProcessorException
*/
public function extractCustomPropertiesForDoPayment(PropertyBag $propertyBag, Array $params, $component = 'contribute') {
// example
// (validation and casting goes first)
// $propertyBag->setCustomProperty('myprocessor_customPropertyName', $value);
}

/**
* Process payment - this function wraps around both doTransferCheckout and doDirectPayment.
* Any processor that still implements the deprecated doTransferCheckout() or doDirectPayment() should be updated to use doPayment().
Expand Down

0 comments on commit 4fbf25a

Please sign in to comment.