From b76a6ecfa88c71e4a96c6c164d6b6d4d538700d3 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot Date: Tue, 26 Nov 2019 13:01:22 +0000 Subject: [PATCH] adding extractCustomPropertiesForDoPayment() method proof of concept --- CRM/Core/Payment.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 57fa1830aa..5ae135f13d 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1236,6 +1236,23 @@ abstract class CRM_Core_Payment { 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 Civi\Payment\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(). -- 2.25.1