From e08f1e784e3cb96b829066b5f8bd11f2d845925d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reu=CC=88el=20van=20der=20Steege?= Date: Thu, 22 Oct 2020 22:39:17 +0200 Subject: [PATCH] Limit first and last name to 32 characters. --- src/Gateway.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Gateway.php b/src/Gateway.php index 3299d49..72ded16 100644 --- a/src/Gateway.php +++ b/src/Gateway.php @@ -196,11 +196,14 @@ public function start( Payment $payment ) { // Set name from customer. if ( null !== $customer->get_name() ) { - $enduser['initials'] = $customer->get_name()->get_first_name(); - $enduser['lastName'] = $customer->get_name()->get_last_name(); + $first_name = \substr( (string) $customer->get_name()->get_first_name(), 0, 32 ); + $last_name = \substr( (string) $customer->get_name()->get_last_name(), 0, 32 ); - $invoice_address['initials'] = $customer->get_name()->get_first_name(); - $invoice_address['lastName'] = $customer->get_name()->get_last_name(); + $enduser['initials'] = $first_name; + $enduser['lastName'] = $last_name; + + $invoice_address['initials'] = $first_name; + $invoice_address['lastName'] = $last_name; } // Set date of birth.