Skip to content
Snippets Groups Projects
Commit 4406a23e authored by mattwire's avatar mattwire
Browse files

Minor fixes

parent 89ff6a0f
No related branches found
No related tags found
1 merge request!40Support for Stripe 6.9 release
......@@ -329,7 +329,7 @@ trait CRM_Core_Payment_MJWTrait {
$this->_params['country'] = $this->_params["country-{$billingLocationId}"] = $this->_params["billing_country-{$billingLocationId}"] = CRM_Core_PseudoConstant::countryIsoCode($this->_params["billing_country_id-{$billingLocationId}"]);
}
list($hasAddressField, $addressParams) = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $billingLocationId);
[$hasAddressField, $addressParams] = CRM_Contribute_BAO_Contribution::getPaymentProcessorReadyAddressParams($this->_params, $billingLocationId);
if ($hasAddressField) {
$this->_params = array_merge($this->_params, $addressParams);
}
......@@ -355,12 +355,13 @@ trait CRM_Core_Payment_MJWTrait {
* @throws \Civi\Payment\Exception\PaymentProcessorException
* (or statusbounce if URL is specified)
*/
private function handleError($errorCode = NULL, $errorMessage = NULL, $bounceURL = NULL) {
$errorCode = empty($errorCode) ? '' : $errorCode . ': ';
private function handleError($errorCode = '', $errorMessage = '', $bounceURL = NULL, $log = TRUE) {
$errorMessage = empty($errorMessage) ? 'Unknown System Error.' : $errorMessage;
$message = $errorCode . $errorMessage;
$message = $errorMessage . (!empty($errorCode) ? " - {$errorCode}" : '');
Civi::log()->error($this->getPaymentTypeLabel() . ' Payment Error: ' . $message);
if ($log) {
Civi::log()->error($this->getPaymentTypeLabel() . ' Payment Error: ' . $message);
}
if ($this->handleErrorThrowsException) {
// We're in a test environment. Throw exception.
throw new \Exception('Exception thrown to avoid statusBounce because handleErrorThrowsException is set.' . $message);
......
......@@ -27,7 +27,7 @@ function myextension_civicrm_webhookEventNotMatched(string $type, $object, strin
if ($type !== 'stripe') {
return;
}
if (!($object instanceof CRM_Core_Payment_StripeIPN)) {
if (!($object instanceof CRM_Core_Payment_StripeIPN) && !($object instanceof \Civi\Stripe\Webhook\Events)) {
return;
}
switch ($code) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment