Commit c53420c2 authored by mattwire's avatar mattwire
Browse files

Send email receipts from Stripe by default (as this was what 5.x did)

parent 599779dc
......@@ -472,18 +472,24 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
];
$intentParams['statement_descriptor_suffix'] = "{$contactContribution} " . substr($params['description'],0,7);
$intentParams['statement_descriptor'] = substr("{$contactContribution} " . $params['description'], 0, 22);
$intentMetadata = [
'amount_to_capture' => $this->getAmount($params),
];
// This is where we actually charge the customer
try {
\Stripe\PaymentIntent::update($params['paymentIntentID'], $intentParams);
$intent = \Stripe\PaymentIntent::retrieve($params['paymentIntentID']);
if ($intent->amount !== $this->getAmount($params)) {
$this->handleError('Amount differs', E::ts('Amount is different from the authorised amount (%1, %2)', [1 => $intent->amount, 2=> $this->getAmount($params)]), $params['stripe_error_url']);
}
switch ($intent->status) {
case 'requires_confirmation':
$intent->confirm();
case 'requires_capture':
$intent->capture($intentMetadata);
$intent->capture();
if ((boolean) \Civi::settings()->get('stripe_oneoffreceipt')) {
// Send a receipt from Stripe - we have to set the receipt_email after the charge has been captured,
// as the customer receives an email as soon as receipt_email is updated and would receive two if we updated before capture.
\Stripe\PaymentIntent::update($params['paymentIntentID'], ['receipt_email' => $email]);
}
break;
}
}
......
#Stripe Payment Processor for CiviCRM.
# Stripe Payment Processor for CiviCRM.
Integrates the Stripe payment processor (for Credit/Debit cards) into CiviCRM so you can use it to accept Credit / Debit card payments on your site.
[![Stripe Logo](/images/stripe.png)](https://stripe.com/)
Latest releases can be found here: https://civicrm.org/extensions/stripe-payment-processor
View this extension in the [Extension Directory](https://civicrm.org/extensions/stripe-payment-processor).
View/Download this extension in the [Extension Directory](https://civicrm.org/extensions/stripe-payment-processor).
## Compatibility / Requirements
* CiviCRM 5.13+
......
## Release 6.1.5
* Send email receipts from Stripe by default (as this was what 5.x did). Add a setting under Administer->CiviContribute->Stripe Settings to enable/disable receipts from Stripe.
## Release 6.1.4
**This release fixes a MAJOR issue that caused duplicate payments to be taken when a new recurring contribution (subscription) was setup. All users of 6.x should upgrade.**
......
# Setup and configuration
Please make sure you have read and followed the instructions under [Install](/install) first.
## Receipts
In addition to the receipts that CiviCRM can send, Stripe will send it's own receipt for payment by default.
If you wish to disable this under *Administer->CiviContribute->Stripe Settings* you can find a setting that allows you to disable Stripe from sending receipts:
* Allow Stripe to send a receipt for one-off payments?
......@@ -13,8 +13,8 @@
<author>Matthew Wire (MJW Consulting)</author>
<email>mjw@mjwconsult.co.uk</email>
</maintainer>
<releaseDate>2019-09-23</releaseDate>
<version>6.1.4</version>
<releaseDate>2019-09-25</releaseDate>
<version>6.1.5</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.13</ver>
......
......@@ -18,6 +18,7 @@ pages:
- About: index.md
- Examples / Screenshots: examples.md
- Installation: install.md
- Setup: setup.md
- Webhooks (Notifications): webhook.md
- Contributions, Payments and Customers: contribution.md
- Recurring Contributions (Subscriptions): recur.md
......
......@@ -17,6 +17,23 @@ return [
'title' => E::ts('Enable Stripe Javascript debugging?'),
'description' => E::ts('Enables debug logging to browser console for stripe payment processors.'),
'html_attributes' => [],
'settings_pages' => [
'stripe' => [
'weight' => 15,
]
],
],
'stripe_oneoffreceipt' => [
'name' => 'stripe_oneoffreceipt',
'type' => 'Boolean',
'html_type' => 'checkbox',
'default' => 1,
'add' => '5.13',
'is_domain' => 1,
'is_contact' => 0,
'title' => E::ts('Allow Stripe to send a receipt for one-off payments?'),
'description' => E::ts('Sets the "email_receipt" parameter on a Stripe Charge so that Stripe can send an email receipt.'),
'html_attributes' => [],
'settings_pages' => [
'stripe' => [
'weight' => 10,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment