Skip to content

Commit

Permalink
Merge pull request #21 from horgh/horgh/credit-card-is-business
Browse files Browse the repository at this point in the history
Add support for the /credit_card/is_business output
  • Loading branch information
kushniryb committed May 18, 2020
2 parents 9341199 + 8a66b97 commit 10a60b5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Minfraud Changelog

* Adds support for the new credit card output `/credit_card/is_business`.
This indicates whether the card is a business card. It may be accessed
via `response.credit_credit.is_business` on the minFraud Insights and
Factors response objects.
* Adds support for the new email domain output `/email/domain/first_seen`.
This may be accessed via `response.email.domain.first_seen` on the
minFraud Insights and Factors response objects.
Expand Down
6 changes: 6 additions & 0 deletions lib/minfraud/model/credit_card.rb
Expand Up @@ -22,6 +22,11 @@ class CreditCard < Abstract
# @return [String, nil]
attr_reader :country

# This property is true if the card is a business card.
#
# @return [Boolean, nil]
attr_reader :is_business

# This property is true if the country of the billing address matches the
# country of the majority of customers using this credit card. In cases
# where the location of customers is highly mixed, the match is to the
Expand Down Expand Up @@ -56,6 +61,7 @@ def initialize(record)

@brand = get('brand')
@country = get('country')
@is_business = get('is_business')
@is_issued_in_billing_address_country = get(
'is_issued_in_billing_address_country'
)
Expand Down
1 change: 1 addition & 0 deletions spec/fixtures/files/insights-response1.json
Expand Up @@ -144,6 +144,7 @@
},
"brand": "Visa",
"country": "US",
"is_business": true,
"is_issued_in_billing_address_country": true,
"is_prepaid": true,
"is_virtual": true,
Expand Down
2 changes: 2 additions & 0 deletions spec/model/insights_spec.rb
Expand Up @@ -99,6 +99,7 @@

expect(m.credit_card.brand).to eq 'Visa'
expect(m.credit_card.country).to eq 'US'
expect(m.credit_card.is_business).to eq true
expect(m.credit_card.is_issued_in_billing_address_country).to eq true
expect(m.credit_card.is_prepaid).to eq true
expect(m.credit_card.is_virtual).to eq true
Expand Down Expand Up @@ -170,6 +171,7 @@
expect(m.billing_address.is_in_ip_country).to eq false

expect(m.credit_card.issuer.name).to eq 'Bank of No Hope'
expect(m.credit_card.is_business).to eq nil
expect(m.credit_card.issuer.matches_provided_name).to eq nil

expect(m.credit_card.brand).to eq nil
Expand Down

0 comments on commit 10a60b5

Please sign in to comment.