8000 Merge branch '5.3' into 5.4 · symfony/symfony@34e1972 · GitHub
[go: up one dir, main page]

Skip to content

Commit 34e1972

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: [Validator] Update MIR card scheme [Mailer][Sendgrid] Add previous exception
2 parents f2ef55c + 59ed190 commit 34e1972

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6464

6565
throw new HttpTransportException('Unable to send an email: '.implode('; ', array_column($result['errors'], 'message')).sprintf(' (code %d).', $statusCode), $response);
6666
} catch (DecodingExceptionInterface $e) {
67-
throw new HttpTransportException('Unable to send an email: '.$response->getContent(false).sprintf(' (code %d).', $statusCode), $response);
67+
throw new HttpTransportException('Unable to send an email: '.$response->getContent(false).sprintf(' (code %d).', $statusCode), $response, 0, $e);
6868
}
6969
}
7070

src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ class CardSchemeValidator extends ConstraintValidator
7777
'/^5[1-5][0-9]{14}$/',
7878
'/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/',
7979
],
80-
// Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then 12 digits
80+
// Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits
8181
CardScheme::MIR => [
82-
'/^220[0-4][0-9]{12}$/',
82+
'/^220[0-4][0-9]{12,15}$/',
8383
],
8484
// All UATP card numbers start with a 1 and have a length of 15 digits.
8585
CardScheme::UATP => [

src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ public function getValidNumbers()
130130
['MASTERCARD', '2709999999999999'],
131131
['MASTERCARD', '2720995105105100'],
132132
['MIR', '2200381427330082'],
133+
['MIR', '22003814273300821'],
134+
['MIR', '220038142733008212'],
135+
['MIR', '2200381427330082123'],
133136
['UATP', '110165309696173'],
134137
['VISA', '4111111111111111'],
135138
['VISA', '4012888888881881'],
@@ -162,7 +165,8 @@ public function getInvalidNumbers()
162165
['MASTERCARD', '2721001234567890', CardScheme::INVALID_FORMAT_ERROR], // Not assigned yet
163166
['MASTERCARD', '2220991234567890', CardScheme::INVALID_FORMAT_ERROR], // Not assigned yet
164167
['UATP', '11016530969617', CardScheme::INVALID_FORMAT_ERROR], // invalid length
165-
['MIR', '22003814273300821', CardScheme::INVALID_FORMAT_ERROR], // invalid length
168+
['MIR', '220038142733008', CardScheme::INVALID_FORMAT_ERROR], // invalid length
169+
['MIR', '22003814273300821234', CardScheme::INVALID_FORMAT_ERROR], // invalid length
166170
];
167171
}
168172
}

0 commit comments

Comments
 (0)
0