Skip to content

Inconsistent IPN schema with CiviCRM Core? #252

@bastienho

Description

@bastienho

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions