Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Stripe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rich
Stripe
Commits
48cb7084
Commit
48cb7084
authored
7 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Allow submit of a different payment processor when Stripe is default but not selected
parent
76099723
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Core/Payment/Stripe.php
+1
-1
1 addition, 1 deletion
CRM/Core/Payment/Stripe.php
js/civicrm_stripe.js
+17
-16
17 additions, 16 deletions
js/civicrm_stripe.js
with
18 additions
and
17 deletions
CRM/Core/Payment/Stripe.php
+
1
−
1
View file @
48cb7084
...
...
@@ -891,7 +891,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
*
*/
public
function
doTransferCheckout
(
&
$params
,
$component
)
{
CRM_Core_Error
::
fatal
(
ts
(
'Use direct billing instead of Transfer method.'
)
);
self
::
doDirectPayment
(
$params
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
js/civicrm_stripe.js
+
17
−
16
View file @
48cb7084
...
...
@@ -141,6 +141,23 @@
return
false
;
}
// Handle multiple payment options and Stripe not being chosen.
if
(
$form
.
find
(
"
.crm-section.payment_processor-section
"
).
length
>
0
)
{
var
extMode
=
$
(
'
#ext-mode
'
).
val
();
var
stripeProcessorId
=
$
(
'
#stripe-id
'
).
val
();
var
chosenProcessorId
=
$form
.
find
(
'
input[name="payment_processor_id"]:checked
'
).
val
();
// Bail if we're not using Stripe or are using pay later (option value '0' in payment_processor radio group).
if
((
chosenProcessorId
!==
stripeProcessorId
)
||
(
chosenProcessorId
===
0
))
{
debugging
(
'
debug: Not a Stripe transaction, or pay-later
'
);
$form
.
get
(
0
).
submit
();
return
true
;
}
}
else
{
debugging
(
'
debug: Stripe is the selected payprocessor
'
);
}
$form
=
getBillingForm
();
// Don't handle submits generated by non-stripe processors
...
...
@@ -192,22 +209,6 @@
// Disable the submit button to prevent repeated clicks
$submit
.
prop
(
'
disabled
'
,
true
);
// Handle multiple payment options and Stripe not being chosen.
if
(
$form
.
find
(
"
.crm-section.payment_processor-section
"
).
length
>
0
)
{
var
extMode
=
$
(
'
#ext-mode
'
).
val
();
var
stripeProcessorId
=
$
(
'
#stripe-id
'
).
val
();
var
chosenProcessorId
=
$form
.
find
(
'
input[name="payment_processor_id"]:checked
'
).
val
();
// Bail if we're not using Stripe or are using pay later (option value '0' in payment_processor radio group).
if
((
chosenProcessorId
!==
stripeProcessorId
)
||
(
chosenProcessorId
===
0
))
{
debugging
(
'
debug: Not a Stripe transaction, or pay-later
'
);
return
true
;
}
}
else
{
debugging
(
'
debug: Stripe is the selected payprocessor
'
);
}
// If there's no credit card field, no use in continuing (probably wrong
// context anyway)
if
(
!
$form
.
find
(
'
#credit_card_number
'
).
length
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment