Skip to content

Commit

Permalink
Add Mastercard Stripe example as a valid coBrand
Browse files Browse the repository at this point in the history
  • Loading branch information
douglaslise committed Sep 29, 2022
1 parent 16c405a commit 5bbdf38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/const/credit-card-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"ranges": [
[2221, 2720],
[51, 55]
]
],
"co_brands": {
"cartes_bancaires": [
[55555525, 55555525]
]
}
}
],
"diners_club": [
Expand Down
5 changes: 5 additions & 0 deletions test/unit/validate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ describe('Recurly.validate', function () {
assert.strictEqual(recurly.validate.cardCoBrand('4360 0000 0100 0005'), 'cartes_bancaires');
});

it('should parse mastercard cartes bancaires', function () {
assert.strictEqual(recurly.validate.cardType('5555-5525-0000-1001'), 'master');
assert.strictEqual(recurly.validate.cardCoBrand('5555-5525-0000-1001'), 'cartes_bancaires');
});

it('should return null for other cards', function () {
assert.strictEqual(recurly.validate.cardCoBrand('4111-1111-1111-1111'), undefined);
assert.strictEqual(recurly.validate.cardCoBrand('5454-5454-5454-5454'), undefined);
Expand Down

0 comments on commit 5bbdf38

Please sign in to comment.