Support calling ContributionPage.validate in POST context.
authoreileen <emcnaughton@wikimedia.org>
Mon, 11 Mar 2019 00:04:57 +0000 (13:04 +1300)
committereileen <emcnaughton@wikimedia.org>
Thu, 14 Mar 2019 22:23:47 +0000 (11:23 +1300)
commitdbc654ec81263616178d32782adbc45c088d9473
tree2e6d7a3dd6a3b804be5c60881e2ed9d54df7921d
parent19c56bdc4b8a915f55cfb6d6576ab9736e8559da
Support calling ContributionPage.validate in POST context.

Because the validation data is buried deep within the form we need to load the form
in order to validate - but currently the validKey check borks in post requests.

Note the validity of credit card details is not checked when submitting this form,
other than possibly the luhn validation.

 A likely use case for the validation is when the is being submitted and some handling is
 to be done before processing but the validity of input needs to be checked first.

 For example Paypal Checkout will replace the confirm button with it's own but we are able to validate
before paypal launches it's modal. In this case the  is post but we need validation to succeed.
api/v3/ContributionPage.php
tests/phpunit/api/v3/ContributionPageTest.php