Skip to content
Snippets Groups Projects
Commit eed5958e authored by drastik's avatar drastik
Browse files

GitHub issue #18

From: https://github.com/drastik/civicrm_stripe/issues/18
Remove all non-numeric characters from amount.
by DaveBagler
parent ae447930
No related branches found
No related tags found
No related merge requests found
......@@ -202,10 +202,9 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
Stripe::setApiKey($this->_paymentProcessor['user_name']);
// Stripe amount required in cents.
$amount = $params['amount'] * 100;
$amount = (int)preg_replace('/[^\d]/', '', strval($params['amount']));
// It would require 3 digits after the decimal for one to make it this far.
// CiviCRM prevents this, but let's be redundant.
$amount = number_format($amount, 0, '', '');
// Get Cardholder's full name.
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment