Skip to content
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

Add is email receipt as doPayment parameter #985

Open
wants to merge 1 commit into
base: 6.x
Choose a base branch
from

Conversation

francescbassas
Copy link
Contributor

@francescbassas francescbassas commented Jul 23, 2024

Overview

This little modification allows transfer if the Webform takes care of sending the receipt to doPayment function.

This can allow, for example, payment gateways like Redsys to decide whether to manage the sending of receipts or delegate it to the webform.

@@ -2160,6 +2164,7 @@ private function submitIPNPayment() {
$params['cancelURL'] = $this->getIpnRedirectUrl('cancel');
}

$params['is_email_receipt'] = $isEmailReceipt;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simply use

$params['is_email_receipt'] = wf_crm_aval($this->data, "receipt:number_number_of_receipt", FALSE);

instead of sending $isEmailReceipt as a param argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Like this? #987

@mattwire
Copy link
Collaborator

The problem with this is that it's completely unsupported to pass in a parameter for email receipt to doPayment(). I'm not actually aware of any payment processors that would support that?

I do understand that there is a problem to solve - we can set email_receipt on contribution_page or contribution_recur but not on the contribution itself but I think that needs to be solved in CiviCRM first.
Also, the receipt would not usually be sent from within doPayment() as it would be handled when recording the payment which would be done when the IPN code is invoked.

I think we'd need support for a receipt parameter in CiviCRM first (maybe an additional field in civicrm_contribution that could be set?).

@francescbassas
Copy link
Contributor Author

Thanks @mattwire

With this, I'm trying to resolve the Redsys payment processor casuistry when its IPN it's invoked. The idea with the change is that the payment processor can distinguish when the webform is already managing the sending of the receipt and, therefore, not send the one that is enabled by default. I don't know if there is any other payment processor that could also benefit.

cc @sluc23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants