Skip to content
Snippets Groups Projects
Commit 24a19fff authored by mattwire's avatar mattwire
Browse files

Fix #306 Can't pay for event with more then one participant

parent 028f1f66
Branches
Tags
No related merge requests found
......@@ -9,7 +9,7 @@ Releases use the following numbering system:
* **[BC]**: Items marked with [BC] indicate a breaking change that will require updates to your code if you are using that code in your extension.
## Release 6.6 (not yet released 2021-04-10)
## Release 6.6 (not yet released 2021-05-09)
**Requires mjwshared (Payment Shared) 1.0**
**Access AJAX API permission is required** for all users that make payments using Stripe (including the anonymous user).
......@@ -34,6 +34,7 @@ Make sure you update your CMS user roles to include this permission.
* Make more javascript strings translatable.
* Disable billing fields by default.
* Add 6.6 upgrade message to system checks.
* Fix [#306](https://lab.civicrm.org/extensions/stripe/-/issues/306) Can't pay for event with more then one participant.
## Release 6.5.8
......
......@@ -15,7 +15,7 @@
<author>Matthew Wire (MJW Consulting)</author>
<email>mjw@mjwconsult.co.uk</email>
</maintainer>
<releaseDate>2021-04-12</releaseDate>
<releaseDate>2021-05-09</releaseDate>
<version>6.6-dev</version>
<develStage>beta</develStage>
<compatibility>
......
......@@ -200,12 +200,14 @@
// For recur, additional participants we do NOT know the final amount so must create a paymentMethod and only create the paymentIntent
// once the form is finally submitted.
// We should never get here with amount=0 as we should be doing a "nonStripeSubmit()" instead. This may become needed when we save cards
if (CRM.payment.getIsRecur() || CRM.payment.isEventAdditionalParticipants() || (CRM.payment.getTotalAmount() === 0.0)) {
var totalAmount = CRM.payment.getTotalAmount();
if (totalAmount) { totalAmount = totalAmount.toFixed(2); }
if (CRM.payment.getIsRecur() || CRM.payment.isEventAdditionalParticipants() || (totalAmount === null)) {
CRM.api3('StripePaymentintent', 'createorupdate', {
stripe_intent_id: createPaymentMethodResult.paymentMethod.id,
description: document.title,
payment_processor_id: CRM.vars.stripe.id,
amount: CRM.payment.getTotalAmount().toFixed(2),
amount: totalAmount,
currency: CRM.payment.getCurrency(CRM.vars.stripe.currency),
status: 'payment_method',
csrfToken: CRM.vars.stripe.csrfToken,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment