eileenmcnaughton / nz.co.fuzion.omnipaymultiprocessor

Omnipay Multi Processor Payment Processor For CiviCRM
Other
14 stars 44 forks source link

Inconsistent IPN schema with CiviCRM Core? #252

Open bastienho opened 1 year ago

bastienho commented 1 year ago

in CRM/Core/Payment/PaymentExtended.php, the IPN is built like this: civicrm/payment/ipn/TRANSATION_ID/paymentProcessor_ID

protected function getNotifyUrl($allowLocalHost = FALSE) {
    $url = CRM_Utils_System::url(
      'civicrm/payment/ipn/' . $this->formatted_transaction_id . '/' . $this->_paymentProcessor['id'],
      NULL,
      TRUE,
      NULL,
      FALSE,
      TRUE
    );
    return $allowLocalHost ? $url : ((stristr($url, '.')) ? $url : '');
  }

By the way, in CiviCRM core: extern/ipn.php, I can read:

This script processes "Instant Payment Notifications" (IPNs). Modern Payment Processors use the /civicrm/payment/ipn/123 endpoint instead (where 123 is the payment processor ID)

So does the abstract CRM_Core_Payment

protected function getNotifyUrl() {
    $url = CRM_Utils_System::getNotifyUrl(
      'civicrm/payment/ipn/' . $this->_paymentProcessor['id'],
      [],
      TRUE,
      NULL,
      FALSE,
      TRUE
    );
    return (stristr($url, '.')) ? $url : '';
  }

Maybe it's assumed, but I'dd like to know why this choice?

This is not very convenient because we can't fill a static URL to providers.