Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
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
Extensions
Stripe
Commits
c93529d3
Commit
c93529d3
authored
2 years ago
by
mattwire
Browse files
Options
Downloads
Patches
Plain Diff
Fix missing error handler
parent
a615584e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!209
6.8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CRM/Stripe/BAO/StripeCustomer.php
+3
-3
3 additions, 3 deletions
CRM/Stripe/BAO/StripeCustomer.php
CRM/Stripe/Customer.php
+2
-1
2 additions, 1 deletion
CRM/Stripe/Customer.php
Civi/Api4/Action/StripePaymentintent/ProcessPublic.php
+1
-1
1 addition, 1 deletion
Civi/Api4/Action/StripePaymentintent/ProcessPublic.php
with
6 additions
and
5 deletions
CRM/Stripe/BAO/StripeCustomer.php
+
3
−
3
View file @
c93529d3
...
...
@@ -75,9 +75,9 @@ class CRM_Stripe_BAO_StripeCustomer extends CRM_Stripe_DAO_StripeCustomer {
$stripeCustomer
=
$stripe
->
stripeClient
->
customers
->
update
(
$stripeCustomerID
,
$stripeCustomerParams
);
}
catch
(
Exception
$e
)
{
$err
=
CRM_Core_Payment_Stripe
::
parseStripeException
(
'create_customer'
,
$e
,
FALSE
);
$errorMessage
=
$stripe
->
handleErrorNotification
(
$err
,
$params
[
'error_url'
]
);
throw
new
\Civi\Payment\Exception\PaymentProcessorException
(
'Failed to update Stripe Customer: '
.
$err
orMessage
);
$err
=
CRM_Core_Payment_Stripe
::
parseStripeException
(
'create_customer'
,
$e
);
\Civi
::
log
(
'stripe'
)
->
error
(
'Failed to create Stripe Customer: '
.
$err
[
'message'
]
.
'; '
.
print_r
(
$err
,
TRUE
)
);
throw
new
\Civi\Payment\Exception\PaymentProcessorException
(
'Failed to update Stripe Customer: '
.
$err
[
'code'
]
);
}
return
$stripeCustomer
;
}
...
...
This diff is collapsed.
Click to expand it.
CRM/Stripe/Customer.php
+
2
−
1
View file @
c93529d3
...
...
@@ -113,7 +113,8 @@ class CRM_Stripe_Customer {
$stripeCustomer
=
$stripe
->
stripeClient
->
customers
->
create
(
$stripeCustomerParams
);
}
catch
(
Exception
$e
)
{
$err
=
CRM_Core_Payment_Stripe
::
parseStripeException
(
'create_customer'
,
$e
,
FALSE
);
$err
=
CRM_Core_Payment_Stripe
::
parseStripeException
(
'create_customer'
,
$e
);
\Civi
::
log
(
'stripe'
)
->
error
(
'Failed to create Stripe Customer: '
.
$err
[
'message'
]
.
'; '
.
print_r
(
$err
,
TRUE
));
throw
new
PaymentProcessorException
(
'Failed to create Stripe Customer: '
.
$err
[
'code'
]);
}
...
...
This diff is collapsed.
Click to expand it.
Civi/Api4/Action/StripePaymentintent/ProcessPublic.php
+
1
−
1
View file @
c93529d3
...
...
@@ -117,7 +117,7 @@ class ProcessPublic extends \Civi\Api4\Generic\AbstractAction {
$moneyAmount
=
Money
::
of
(
$this
->
amount
,
$this
->
currency
,
new
DefaultContext
(),
RoundingMode
::
CEILING
);
$moneyMinAmount
=
Money
::
of
(
$minAmount
,
$this
->
currency
,
new
DefaultContext
(),
RoundingMode
::
CEILING
);
if
(
$moneyAmount
->
isLessThan
(
$moneyMinAmount
))
{
\Civi
::
log
(
'stripe'
)
->
error
(
__CLASS__
.
'amount: '
.
$this
->
amount
.
' is less than min_amount: '
.
$minAmount
);
\Civi
::
log
(
'stripe'
)
->
error
(
'StripeProcessintent: '
.
'amount: '
.
$this
->
amount
.
' is less than min_amount: '
.
$minAmount
);
throw
new
\CRM_Core_Exception
(
'Bad request'
);
}
}
...
...
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