-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event Payments - Transaction ID Issue #223
Comments
@eileenmcnaughton I did some further checking on this looking at Civi code (5.46.2) It seems that for event payments, payment processing is done BEFORE a contribution record is created. The "doPayment()" and more importantly, "processPaymentNotification()" methods of the plugin expects a contributionID to be available. For event payments, there will be no contribution ID available at the time of payment processing. This presents an issue for off-site payments where the execution flow for a payment involves browser redirect. For event payments,
Gateways that do not redirect the browser are OK since the payment processing simply returns and the execution flow of CRM_Event_Form_Registration_Confirm->postProcess() is completed, that is, a contribution is created and marked as completed. I do not see a way forward except for changes to be made in "CRM_Event_Form_Registration_Confirm->postProcess()" where a pending contribution is created before payment processing and the contributionID is added to the parameter array for the payment processor. The contribution can then be updated once the payment processing returns, or in the case of your plugin, the contribution is updated from outside the "CRM_Event_Form_Registration_Confirm->postProcess()" flow. |
@cloudcogsio I think you are right that the change should be made in |
I didn't see an Issues tab in https://github.com/civicrm/civicrm-core |
Civi 5.45.1 on Wordpress
I seem to be having an issue where the TransactionID is not being set/passed to the gateway for Event Payments.
As a result, the gateway is autogenerating a TransactionID (which is required by the gateway).
This works fine for payments that use the gateway's "purchase" method directly.
However, for payments that are processed off-site (3DS verification), I am getting an error when the gateway posts back to the IPN url.
Error: ipn_payment_callback_exception
Message: "An error may have occurred. Please check your receipt is correct XXX is not a valid integer."
(where XXX is the transaction Id that was generated by the gateway).
Backtrace info:
nz.co.fuzion.omnipaymultiprocessor/CRM/Core/Payment/OmnipayMultiProcessor.php(839)
CRM_Core_Payment_PaymentExtended->handleError('error', 'ipn_completion ...'...
As far as I can tell, the root cause seems to be (only for event payments), the usual integer ID that is passed for a contribution is not being passed for the event payment, however the IPN handler expects the transaction Id that is posted back from an offsite payment to be an integer.
The gateway requires the application to pass a TransactionId. Since none is being passed, it then autogenerates a transaction Id.
This transaction ID must however be unique on the gateway's end, so guessing/passing an arbitrary integer is not viable.
Note, contributions work fine with both direct and offsite payments since the integer transaction Id is being passed to the gateway for those payment transactions. Issue affects off-site event payments only.
The text was updated successfully, but these errors were encountered: