Commit e9d7a603 authored by mattwire's avatar mattwire

Fix required params check for CRM_Stripe_Customer

parent 7d52dafa
...@@ -13,7 +13,7 @@ class CRM_Stripe_Customer { ...@@ -13,7 +13,7 @@ class CRM_Stripe_Customer {
public static function find($params) { public static function find($params) {
$requiredParams = ['is_live', 'processor_id']; $requiredParams = ['is_live', 'processor_id'];
foreach ($requiredParams as $required) { foreach ($requiredParams as $required) {
if (empty($required)) { if (empty($params[$required])) {
throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (find): Missing required parameter: ' . $required); throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (find): Missing required parameter: ' . $required);
} }
} }
...@@ -96,7 +96,7 @@ class CRM_Stripe_Customer { ...@@ -96,7 +96,7 @@ class CRM_Stripe_Customer {
public static function add($params) { public static function add($params) {
$requiredParams = ['contact_id', 'customer_id', 'is_live', 'processor_id']; $requiredParams = ['contact_id', 'customer_id', 'is_live', 'processor_id'];
foreach ($requiredParams as $required) { foreach ($requiredParams as $required) {
if (empty($required)) { if (empty($params[$required])) {
throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (add): Missing required parameter: ' . $required); throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (add): Missing required parameter: ' . $required);
} }
} }
...@@ -123,7 +123,7 @@ class CRM_Stripe_Customer { ...@@ -123,7 +123,7 @@ class CRM_Stripe_Customer {
$requiredParams = ['contact_id', 'card_token', 'is_live', 'processor_id']; $requiredParams = ['contact_id', 'card_token', 'is_live', 'processor_id'];
// $optionalParams = ['email']; // $optionalParams = ['email'];
foreach ($requiredParams as $required) { foreach ($requiredParams as $required) {
if (empty($required)) { if (empty($params[$required])) {
throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (create): Missing required parameter: ' . $required); throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (create): Missing required parameter: ' . $required);
} }
} }
...@@ -171,7 +171,7 @@ class CRM_Stripe_Customer { ...@@ -171,7 +171,7 @@ class CRM_Stripe_Customer {
public static function delete($params) { public static function delete($params) {
$requiredParams = ['is_live', 'processor_id']; $requiredParams = ['is_live', 'processor_id'];
foreach ($requiredParams as $required) { foreach ($requiredParams as $required) {
if (empty($required)) { if (empty($params[$required])) {
throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (delete): Missing required parameter: ' . $required); throw new \Civi\Payment\Exception\PaymentProcessorException('Stripe Customer (delete): Missing required parameter: ' . $required);
} }
} }
......
Markdown is supported
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