dev/financial#77 ++ Make contribution_id mandatory for PaymentProcessor.pay, pass...
authoreileen <emcnaughton@wikimedia.org>
Mon, 28 Oct 2019 10:05:18 +0000 (23:05 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 28 Oct 2019 10:10:18 +0000 (23:10 +1300)
commit783b62a7dfe3c94bd69bcb182732b240e53911be
treeb302197f5c1eaf411310d81e52a1099087e2cb77
parent6f2246e5edb9ae980693e89d1aea4d9a76dae3cb
dev/financial#77 ++ Make contribution_id mandatory for PaymentProcessor.pay, pass incoieID

Replaces https://github.com/civicrm/civicrm-core/pull/15477 & also resolves https://lab.civicrm.org/dev/financial/issues/77

by requiring contribution_id for PaymentProcessor.pay as a way to ensure that it is only called after the order is created
per our preferred flow (people could still get past this but it feels like they would at least know they werre
hacking our process & take responsibility for any issues if it breaks or we suddenly start enforcing that
it is a valid contribution.

This also sets some of the recommended variables. Note that I had to use a few more lines to ensure we were always setting
contactID, contributionRecurID to an integer. I do think this stricter approach is better but it wound up
more verbose
api/v3/PaymentProcessor.php
tests/phpunit/api/v3/PaymentProcessorTest.php