Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from original repository #8

Merged
merged 554 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
554 commits
Select commit Hold shift + click to select a range
4261edb
Stripe: Fix header for test account deletion call
curiousepic Oct 21, 2022
d165b0a
Changelog fix
curiousepic Oct 21, 2022
262aa9f
Alelo: Trigger access token refresh on 404
curiousepic Oct 25, 2022
2023875
DLocal: Add Network Tokens
Oct 18, 2022
5a9b19d
Redsys: enable NTID generation with zero-value verify
jcreiff Oct 26, 2022
869c13e
IPG Gateway: override store id
aenand Nov 1, 2022
a2739af
Adyen: Field support for Level 2 and level 3 information
scastilloendava Oct 20, 2022
b56eb3f
Add alternate alpha2 country code for Kosovo
jcreiff Nov 4, 2022
9b4ffcc
CyberSource: Refactor and add support for several fields
rachelkirk Nov 4, 2022
42650fd
Reach: adding gateway (#4618)
Heavyblade Nov 9, 2022
88da8e6
Orbital: integration improvements
molbrown Nov 3, 2022
e1ed19f
Reach: Adding custom fields (#4627)
jherreraa Nov 15, 2022
c67af05
iVeri: Add additional url
Nov 16, 2022
5861876
Payeezy: Add apple pay
ajawadmirza Oct 3, 2022
c7dd37b
Payeezy Scrub Cryptogram (#4633)
naashton Nov 18, 2022
5e0c9b8
Reach: add Scrubing (#4620)
gasb150 Nov 21, 2022
77d6e0b
CyberSource: Refactor to better adhere to XSD
rachelkirk Nov 21, 2022
ef9b670
CyberSource:Add fix for source.stored
marioarranzr Nov 11, 2022
5bc423f
Mundipagg: send authorization_secret_key on all transaction types
edgarv09 Nov 21, 2022
7fea8f3
Revert "CyberSource: Refactor to better adhere to XSD"
rachelkirk Nov 28, 2022
5a128f2
CommerceHub: Add new gateway
ajawadmirza Oct 6, 2022
2221acd
Reach: PSP Integration - Verify / Void / Refund (#4641)
Heavyblade Dec 6, 2022
c728c52
CyberSource: Update installment data method
rachelkirk Dec 6, 2022
8b3d833
updating cabal BIN range
bradbroge Dec 7, 2022
64427ce
Reach: Add stored credential support (#4636)
gasb150 Dec 7, 2022
8214fb8
Element: fix bug with billing address email
jcreiff Dec 7, 2022
517febb
Reach: Fixing bug when using union pay card
Heavyblade Dec 9, 2022
3ab743f
Reach: Fix bug CIT-Setup-Unscheduled
Dec 9, 2022
a94e4c6
Openpay: able to set URL by merchant country
edgarv09 Nov 24, 2022
ee0806f
Alelo: Improving credentials refresh process
Heavyblade Oct 26, 2022
2d283a3
Reach: refactor to prevent symbols on response
Heavyblade Dec 16, 2022
c0cbca0
Decidir: Add transaction inquire request
Dec 16, 2022
e40e1ee
Reach: using transaction token as ReferenceId on refunds
Heavyblade Dec 28, 2022
7b973d9
Reach: remove raise exception when pymentMethod is not allowed
Heavyblade Dec 28, 2022
4e1d3cd
Reach: remove raise exception when stored-credentials can't be identi…
Heavyblade Dec 28, 2022
ad2e333
Reach: fixing typo on store credentials uncheduled
Heavyblade Dec 28, 2022
e169025
Reach: refactor response methods and extra test for not paymentMethod
Heavyblade Dec 28, 2022
b344480
Revert "Reach: refactor response methods and extra test for not payme…
Heavyblade Dec 29, 2022
b5a373a
Revert "Reach: fixing typo on store credentials uncheduled"
Heavyblade Dec 29, 2022
dbf0d29
Revert "Reach: remove raise exception when stored-credentials can't b…
Heavyblade Dec 29, 2022
7589086
Revert "Reach: remove raise exception when pymentMethod is not allowed"
Heavyblade Dec 29, 2022
aee3e29
Revert "Reach: using transaction token as ReferenceId on refunds"
Heavyblade Dec 29, 2022
dec6fa0
Reach: fixing store credentials and Exception issues
Heavyblade Dec 29, 2022
3a280d8
EBANX: add soft_descriptor field
jcreiff Dec 27, 2022
c43d5eb
CommerceHub: Add Apple Pay and Google Pay (#4648)
gasb150 Dec 30, 2022
81b0519
Global Collect & Alelo: Fixing year dependent failing tests
Heavyblade Jan 3, 2023
eb2c9f5
Moneris: Add Google Pay
Jan 3, 2023
26d0b6e
Element/Vantiv: Add google pay and apple pay support
jherreraa Dec 14, 2022
5d657f7
Reach: fix amount handling to work with cents properly (#4670)
Heavyblade Jan 6, 2023
9243823
GlobalCollect: Add transaction inquire request
Jan 6, 2023
cf78ce6
Stripe PI: Add Level 3 support
Jan 9, 2023
b91b2bd
Braintree: return additional processor response
jcreiff Dec 21, 2022
fad2525
Payeezy name from `billing_address` on `purchase`
naashton Jan 10, 2023
ba74590
Stripe: add reverse_transfer to void transactions
jcreiff Jan 4, 2023
98ab244
Update Changelog for PR #4668
jcreiff Jan 11, 2023
7e94893
GlobalCollect: fix inquire bug
Jan 11, 2023
5114653
Credorax: Support google pay and apple pay
edgarv09 Dec 28, 2022
a0bc3c6
Plexo: add 5 credit card brands (#4652)
edgarv09 Jan 12, 2023
199d114
Authorize.net: Google pay token support
scastilloendava Dec 6, 2022
40ddda0
Credorax: Add support for Network Tokens
jherreraa Jan 16, 2023
ac06be7
Stripe PI: use MultiResponse in create_setup_intent
jcreiff Jan 18, 2023
f6e3f6c
Payeezy change `method` on capture (#4684)
naashton Jan 20, 2023
a456371
Credorax: Update MIT logic
aenand Jan 23, 2023
2d7e409
Adyen: Add support for `skip_mpi_data` flag
rachelkirk Dec 22, 2022
2eb14a1
Add Canadian Institution Numbers
jcreiff Jan 26, 2023
2044af3
Payeezy: Handle nil and empty values for Apple Pay
naashton Feb 6, 2023
6ef70d6
Tns: update test URL
Feb 14, 2023
9339652
TrustCommerce: Update `authorization_from` to handle `store` response…
jherreraa Feb 15, 2023
68dfff0
TrustCommerce Verify feature added (#4692)
jherreraa Feb 15, 2023
041a06c
Rapyd: Add customer object to transactions (#4664)
javierpedrozaing Feb 15, 2023
186b7ab
CybersourceRest: Add new gateway with authorize and purchase
Heavyblade Jan 30, 2023
e769cdb
CheckoutV2: Add store/unstore (#4677)
gasb150 Feb 17, 2023
0b8c197
Revert "CheckoutV2: Add store/unstore (#4677)" (#4703)
naashton Feb 20, 2023
6f78595
Moneris: Fix google pay (update apple pay) (#4689)
sinourain Feb 21, 2023
34f84fc
Litle: Add prelive url
aenand Feb 24, 2023
86f2f6a
CommerceHub: Adding changes for certification purposes (#4705)
Heavyblade Feb 24, 2023
93edf1f
CommerceHub: Fixing verify status and prevent tokenization (#4716)
Heavyblade Feb 27, 2023
7f6d5a1
Payeezy: Update Stored Credentials
Feb 24, 2023
a0ee519
Remove raise ArgumentError on get requests (#4714)
naashton Feb 28, 2023
6b83b8e
ChekoutV2:Add store/unstore (#4712)
gasb150 Feb 28, 2023
cdaa2f6
CybersourceREST - Refund | Credit
Feb 10, 2023
539c9cf
Payeezy: Ignore `xid` for AP Amex (#4721)
naashton Mar 1, 2023
7768484
TrustCommerce Verify feature added (#4699)
jherreraa Mar 1, 2023
546fea7
CER-440
yunnydang Feb 22, 2023
2daf48b
CER-460 Add descriptor phone number to blue_snap
yunnydang Feb 27, 2023
3684807
Braintree: Update transaction hash method
yunnydang Mar 1, 2023
0e27bce
CyberSourceRest: Add apple pay, google pay
Mar 1, 2023
0b1043d
CyberSourceRest: Add apple pay, google pay
Mar 1, 2023
c70703d
CybersourceREST - Void | Verify
Feb 8, 2023
cd74436
CommerceHub: adjusting reference details (#4723)
Heavyblade Mar 3, 2023
7c0e2f0
Orbital: dismiss CardSecValInd restriction (#4724)
jherreraa Mar 3, 2023
e237ff5
Credorax: Set default ECI values for token transactions
scastilloendava Feb 1, 2023
13a65c1
CyberSource Rest: Add ACH Support
edgarv09 Mar 1, 2023
5b3d112
CommerceHub: setting transactionReferenceId for refunds (#4727)
Heavyblade Mar 7, 2023
b7177ef
Cybersource REST: Adding capture request
Heavyblade Mar 6, 2023
9a01cf2
Paymentez: Add inquire by transaction_id
aenand Mar 7, 2023
a40aaa4
Cybersource Rest - update message response on error
Mar 9, 2023
0ac72dd
Ebanx: Add transaction inquire request
Mar 2, 2023
fcafb3c
CommerceHub: Update fields for transactions with sotred credentials (…
javierpedrozaing Mar 13, 2023
ef66950
Ebanx: Add support of Elo & Hipercard
Feb 17, 2023
01c0d15
Checkout_v2: Add idempotency key support
yunnydang Mar 7, 2023
e8a247c
Adyen: add support for shopper_statement field for capture action
yunnydang Mar 13, 2023
88f1275
Checkout_v2: update idmepotency_key names
yunnydang Mar 14, 2023
c13dc31
* Payeezy: Enable external 3DS
jherreraa Feb 27, 2023
fc742d9
Shift4: Fix `Content-type` value (#4740)
naashton Mar 22, 2023
2aff170
Ebanx: Remove default email
aenand Apr 3, 2023
35b56f5
CyberSourceRest: Add stored credentials support
Feb 22, 2023
ee712d9
Payeezy: Add `last_name` for `add_network_tokenization`
naashton Mar 24, 2023
b156656
Stripe PI: tokenize PM for verify
aenand Apr 3, 2023
1e9c672
Kushki Gateway: Add support for the months and deferred fields
yunnydang Apr 7, 2023
71c88ce
Borgun: Update TrCurrencyExponent
aenand Apr 6, 2023
71f3505
CyberSourceRest: Add gateway specific fields handling
jherreraa Mar 29, 2023
3f995eb
IPG: Improve error handling
Heavyblade Apr 11, 2023
50a09f9
* Shift4: Handle access token failed calls
Heavyblade Mar 28, 2023
3a8c637
Bogus: Add verify, plus assoc. test
willemk Apr 5, 2023
4f42b81
Checkout v2: Add Shipping Address
nicolas-maalouf-cko Apr 14, 2023
88022e8
Release 1.128.0
aenand Apr 24, 2023
d138569
Adyen: update selectedBrand mapping for Google Pay
jcreiff Apr 27, 2023
a753cbc
Shift4: add vendorReference field
jcreiff Apr 27, 2023
a51d854
Litle update the successful_from method
Apr 28, 2023
3a84714
Improve error handling: OAuth
aenand Apr 21, 2023
65d1521
Stripe PI: Add billing address when tokenizing for ApplePay and Googl…
BritneyS Apr 25, 2023
dad65a7
Rexml is no longer a default gem in Ruby 3 (#3852)
espen May 2, 2023
cd91dde
Revert "Rexml is no longer a default gem in Ruby 3 (#3852)" (#4767)
pi3r May 2, 2023
eed45fe
Add rexml as a gem dependency (#4768)
May 3, 2023
7c82f82
Release v1.129.0
pi3r May 3, 2023
6e3cd4b
Mit: Changed how the payload was sent to the gateway
alejandrofloresm Dec 26, 2022
00f1189
Revert "Mit: Changed how the payload was sent to the gateway"
rachelkirk May 3, 2023
41dcafd
PayuLatam:
yunnydang May 5, 2023
03f1959
CyberSource: Handling Canadian bank accounts
Heavyblade Apr 28, 2023
7d42e68
Update Changelog
yunnydang May 9, 2023
1aa48e4
CyberSource Rest: Fixing currency detection
Heavyblade May 12, 2023
f2585c1
Cybersource: Add business rules for NT
aenand May 5, 2023
eae5215
Adyen: Update Mastercard error messaging
kylene-spreedly May 4, 2023
ef18eb6
Authorize.net: update mapping for billing address phone number
jcreiff May 12, 2023
9d6e204
Braintree: update mapping for billing address phone number
jcreiff May 15, 2023
87f20dd
CommerceHub: Enabling multi-use public key encryption (#4771)
jherreraa May 23, 2023
8607bf7
Ogone: Enable 3ds Global for Ogone Gateway (#4776)
javierpedrozaing May 26, 2023
19b7b4f
Borgun change default TrCurrencyExponent and MerchantReturnUrl (#4788)
naashton May 30, 2023
4ac3f2e
Borgun support for GBP currency (#4789)
naashton May 30, 2023
51c1f2d
Worlpay: Fix Google Pay
May 11, 2023
46f7bbc
Stripe PI: Update paramters for creating of customer
May 16, 2023
ef8d6a7
Revert "Stripe PI: Update paramters for creating of customer"
May 31, 2023
38635ca
Cybersource: auto void r230
aenand May 31, 2023
9c30987
Redsys: Set appropriate request fields for stored credentials with CI…
BritneyS May 25, 2023
56d6a47
Stripe & Stripe PI: Validate API Key
Jun 5, 2023
4946d60
Remove last validation for Stripe API Key
Jun 7, 2023
b21feaf
Add BIN for Maestro
jcreiff Jun 2, 2023
98ee03e
DLocal: Add save field on card object
yunnydang May 25, 2023
88943ff
Add support for MsgSubID on PayPal Express requests (#4798)
wikiti Jun 12, 2023
8236186
Checkout_v2: use `credit_card?`, not case equality with `CreditCard` …
bbraschi Jun 12, 2023
29e42a2
Shift4: Enable general credit feature. (#4790)
jherreraa Jun 13, 2023
34a1279
Release v1.130.0
m-ocana Jun 13, 2023
87ee551
Redsys: Add supported countries
jcreiff Jun 13, 2023
7fbffa0
Authorize.net: truncate nameOnAccount for bank refunds
jcreiff Jun 12, 2023
66ba752
Checkout: Add support for several customer data fields
rachelkirk Jun 3, 2023
e72fe66
Worldpay: check payment_method responds to payment_cryptogram and eci…
bbraschi Jun 21, 2023
c2ac257
Release v1.131.0
m-ocana Jun 21, 2023
aeaa33c
Stripe PI: Add new stored credential flag
aenand Jun 8, 2023
34c2caa
Commerce Hub - Add a couple of GSFs (#4786)
sinourain Jun 26, 2023
3aef055
Nuvei (formerly SafeCharge): Add customer details to credit action
yunnydang Jun 28, 2023
997d88e
IPG: Update live url to correct endpoint
curiousepic Jun 30, 2023
70d02bb
vPos: Adding Panal Credit Card type (#4814)
jherreraa Jul 5, 2023
3c34a61
Stripe PI: Update parameters for creation of customer
May 16, 2023
2566c8b
WorldPay: Update xml tag for Credit Cards
Jun 1, 2023
efcd43d
PaywayDotCom: Update live url
jcreiff Jul 3, 2023
0521d61
Stripe: Update login key validation
Jun 26, 2023
c8b989e
CheckoutV2: Parse AVS and CVV checks
aenand Jul 3, 2023
5c9bd17
NMI: Add shipping_firstname, shipping_lastname, shipping_email, and s…
jcreiff Jul 7, 2023
b135d18
Borgun: Update authorization_from & message_from
Jul 7, 2023
97f2037
Kushki: Add Brazil as supported country
Jul 11, 2023
fdac501
Adyen: Add additional data for airline and lodging
Jun 20, 2023
8f663b6
MIT: Changed how the payload was sent to the gateway
alejandrofloresm Dec 26, 2022
8dd0d54
Nuvie/SafeCharge: Add unreferenced refund field
yunnydang Jul 17, 2023
7b9658e
CyberSource: include `paymentSolution` for ApplePay and GooglePay (#4…
bbraschi Jul 20, 2023
643b707
Release v1.132.0
bbraschi Jul 20, 2023
de64108
Fix CHANGELOG after Version 1.132.0 (#4837)
bbraschi Jul 20, 2023
90539ee
CyberSource: remove credentials from tests (#4836)
bbraschi Jul 20, 2023
7220441
Release v1.133.0
bbraschi Jul 20, 2023
79df249
Paysafe: Map order_id to merchantRefNum
jcreiff Jul 24, 2023
c8c2c89
Stripe PI: Gate sending NTID
Jul 11, 2023
3b43529
Update required Ruby version
Jul 3, 2023
3f45193
Release v1.134.0
Jul 25, 2023
d9c926a
Kushki: Enable 3ds2
jherreraa Jul 18, 2023
413f4af
PaymentExpress: correct endpoints
steveh Jul 8, 2023
104d857
Adyen: Support raw refusal reason
aenand Jul 25, 2023
9cfe650
Reach: Update list of supported countries
jcreiff Jul 25, 2023
0ff6eaa
Paysafe: Truncate address fields
jcreiff Jul 25, 2023
23a917c
BT: Add support for Network Tokens
aenand May 11, 2023
47f663b
Kushki: fix add amount default method
yunnydang Jul 31, 2023
bb37917
Rapyd: Add customer object and fix tests
aenand Jul 21, 2023
21d987d
Cybersource: Add merchant_id
Jul 28, 2023
9fa4dce
Wordline (formerly Global Collect): Add agent numberic code and house…
yunnydang Aug 1, 2023
3eaa3ca
Adding deepstack gateway
khoinguyendeepstack Jul 15, 2023
d8af5bf
Braintree: Additional tests for credit transactions
jcreiff Aug 4, 2023
a0538f5
Rapyd: Change nesting of description, statement_descriptor, complete_…
jcreiff Aug 7, 2023
d39ccdd
Rapyd: Add merchant_reference_id
jcreiff Aug 15, 2023
86679d3
Braintree: Add check for ACH on credit
jcreiff Aug 16, 2023
b7e4193
Rapyd: Update handling of `ewallet` and billing address phone
jcreiff Aug 18, 2023
1b08fbd
IPG: Refactor Credentials
aenand Aug 14, 2023
8cd93c2
Braintree Blue: Update the credit card details transaction hash
yunnydang Aug 18, 2023
14c6225
VisaNet Peru: Update generate_purchase_number_stamp
Aug 14, 2023
00fd53f
Adding Oauth Response for access tokens
Aug 11, 2023
7172325
Revert "Adding Oauth Response for access tokens"
Aug 22, 2023
ee2ac1a
CYBS: Recurring NT
aenand Jul 18, 2023
abec2c1
Revert "CYBS: Recurring NT"
aenand Aug 23, 2023
4289353
Deepstack: Update sandbox credentials
khoinguyendeepstack Aug 10, 2023
ef367ec
Release v1.135.0
aenand Aug 24, 2023
f6b99f1
Braintree: Add sca_exemption
Aug 18, 2023
66e4305
Ebanx: Update Verify
Aug 21, 2023
461ff34
Shift4_v2: Inherit securionPay API to enable Shift4v2 (#4860)
javierpedrozaing Aug 29, 2023
3d007ed
Rapyd: 3ds gateway specific (#4876)
javierpedrozaing Sep 1, 2023
4b7265b
TNS: Use the customer specified order_id in the request
yunnydang Aug 30, 2023
587795e
CYBS: Recurring NT
aenand Jul 18, 2023
2eeb3ab
SER-728 Create Verve Card Type. This change new credit card brands ve…
jherreraa Sep 6, 2023
f2b2fcb
Rapyd: Add fields and update stored credential method
yunnydang Aug 29, 2023
3e89d92
CommerceHub: Update headers (#4853)
javierpedrozaing Sep 8, 2023
0013c6f
Adyen: Add the store field
yunnydang Aug 30, 2023
d185244
Stripe PI: Expand balance txns for off session transactions
yunnydang Sep 8, 2023
fdf8d37
Rapyd: Update cvv behavior (#4883)
javierpedrozaing Sep 12, 2023
815dcbc
CyberSource (SOAP): Added support for 3DS exemption request fields
BritneyS Sep 6, 2023
3b28d86
StripePI: Adding network tokenization fields to Stripe PaymentIntents
BritneyS Jul 11, 2023
71ee93e
Shift4: Fixing currency bug (#4887)
Heavyblade Sep 14, 2023
120f215
Rapyd: fixing issue with json encoding and signatures (#4892)
Heavyblade Sep 14, 2023
8b93270
SumUp - Setup, Scrub and Purchase build (#4890)
sinourain Sep 20, 2023
8e375ec
XpayGateway: initia Setup (#4889)
javierpedrozaing Sep 20, 2023
9f4eb4b
Rapyd: Add validation to not send cvv and network_reference_id (#4895)
javierpedrozaing Sep 21, 2023
78be05b
Ebanx: Add Ecuador & Bolivia in supported countries
Sep 19, 2023
2e75e25
Rapyd: Fix cvv validation (#4896)
javierpedrozaing Sep 25, 2023
fab678b
Decidir: Add support for network tokens
Aug 22, 2023
257075c
Braintree: return global_id in response
rachelkirk Sep 12, 2023
054c26c
Element: Fix credit card name bug
Sep 22, 2023
19d0479
Adyen: Add payout endpoint
Sep 12, 2023
e9e00a3
Checkout: Add support for `sender`, `destination` and `instruction` o…
rachelkirk Aug 17, 2023
3931adf
Adding Oauth Response for access tokens
Aug 11, 2023
14f1c3c
CheckoutV2: Update stored credentials
Sep 29, 2023
b10e6c2
Revert "Adding Oauth Response for access tokens"
Oct 3, 2023
f207855
Braintree: Create credit card nonce (#4897)
gasb150 Oct 3, 2023
a585f30
Adyen: Fix bug for shopperEmail
Oct 3, 2023
b5d68f3
Add new cabal bin range
yunnydang Oct 4, 2023
3c578b9
Kushki: Fixing issue with 3DS info on visa cc (#4899)
Heavyblade Oct 5, 2023
6494fb6
Adyen: Add `address_override` to swap address1 and address2
rachelkirk Oct 4, 2023
2165af8
Adyen: Update MIT flagging for NT
aenand Oct 2, 2023
c071479
Moneris: Update sca actions
Sep 29, 2023
072b7fb
Ogone: Add gateway specific 3ds option with default options mapping (…
jherreraa Oct 11, 2023
917cd1e
Rapyd: Add recurrence_type field
yunnydang Oct 12, 2023
e3325e5
Revert "Adyen: Update MIT flagging for NT"
Oct 12, 2023
af6cd39
Revert "Braintree: Create credit card nonce (#4897)" (#4915)
naashton Oct 13, 2023
f2e44d3
SumUp: Add Void and Refund calls (#4891)
sinourain Oct 16, 2023
e19e7c4
Merge remote-tracking branch 'upstream/master' into try_update_from_o…
Ligator Oct 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ruby-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
strategy:
matrix:
version:
- 2.5
- 2.6
- 2.7
gemfile:
- gemfiles/Gemfile.rails50
Expand All @@ -42,3 +40,5 @@ jobs:

- name: Test
run: bundle exec rake test
- name: Linter
run: bundle exec rubocop
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AllCops:
- "lib/active_merchant/billing/gateways/paypal_express.rb"
- "vendor/**/*"
ExtraDetails: false
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7

# Active Merchant gateways are not amenable to length restrictions
Metrics/ClassLength:
Expand All @@ -33,7 +33,7 @@ Layout/DotPosition:
Layout/CaseIndentation:
EnforcedStyle: end

Layout/IndentHash:
Layout/IndentFirstHashElement:
EnforcedStyle: consistent

Naming/PredicateName:
Expand Down
345 changes: 345 additions & 0 deletions CHANGELOG

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ source 'https://rubygems.org'
gemspec

gem 'jruby-openssl', platforms: :jruby
gem 'rubocop', '~> 0.62.0', require: false
gem 'rubocop', '~> 0.72.0', require: false

group :test, :remote_test do
# gateway-specific dependencies, keeping these gems out of the gemspec
gem 'braintree', '>= 3.0.0', '<= 3.0.1'
gem 'braintree', '>= 4.14.0'
gem 'jose', '~> 1.1.3'
gem 'jwe'
gem 'mechanize'
gem 'timecop'
end
3 changes: 2 additions & 1 deletion activemerchant.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.email = '[email protected]'
s.homepage = 'http://activemerchant.org/'

s.required_ruby_version = '>= 2.5'
s.required_ruby_version = '>= 2.7'

s.files = Dir['CHANGELOG', 'README.md', 'MIT-LICENSE', 'CONTRIBUTORS', 'lib/**/*', 'vendor/**/*']
s.require_path = 'lib'
Expand All @@ -26,6 +26,7 @@ Gem::Specification.new do |s|
s.add_dependency('builder', '>= 2.1.2', '< 4.0.0')
s.add_dependency('i18n', '>= 0.6.9')
s.add_dependency('nokogiri', '~> 1.4')
s.add_dependency('rexml', '~> 3.2.5')

s.add_development_dependency('mocha', '~> 1')
s.add_development_dependency('pry')
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
machine:
ruby:
version: '2.5.0'
version: '2.7.0'

dependencies:
cache_directories:
Expand Down
52 changes: 42 additions & 10 deletions lib/active_merchant/billing/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module Billing #:nodoc:
# You may use Check in place of CreditCard with any gateway that supports it.
class Check < Model
attr_accessor :first_name, :last_name,
:bank_name, :routing_number, :account_number,
:account_holder_type, :account_type, :number
:bank_name, :routing_number, :account_number,
:account_holder_type, :account_type, :number

# Used for Canadian bank accounts
attr_accessor :institution_number, :transit_number
Expand All @@ -20,7 +20,7 @@ class Check < Model
309 310 315 320 338 340 509 540 608 614 623 809 815 819 828 829 837 839
865 879 889 899 241 242 248 250 265 275 277 290 294 301 303 307 311 314
321 323 327 328 330 332 334 335 342 343 346 352 355 361 362 366 370 372
376 378 807 853 890
376 378 807 853 890 618 842
)

def name
Expand Down Expand Up @@ -60,20 +60,52 @@ def credit_card?
false
end

def valid_routing_number?
digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
case digits.size
when 9
return checksum(digits) == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
when 8
return CAN_INSTITUTION_NUMBERS.include?(routing_number[5..7])
end

false
end

# Routing numbers may be validated by calculating a checksum and dividing it by 10. The
# formula is:
# (3(d1 + d4 + d7) + 7(d2 + d5 + d8) + 1(d3 + d6 + d9))mod 10 = 0
# See http://en.wikipedia.org/wiki/Routing_transit_number#Internal_checksums
def valid_routing_number?
def checksum(digits)
((3 * (digits[0] + digits[3] + digits[6])) +
(7 * (digits[1] + digits[4] + digits[7])) +
(digits[2] + digits[5] + digits[8])) % 10
end

# Always return MICR-formatted routing number for Canadian routing numbers, US routing numbers unchanged
def micr_format_routing_number
digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
if digits.size == 9
checksum = ((3 * (digits[0] + digits[3] + digits[6])) +
(7 * (digits[1] + digits[4] + digits[7])) +
(digits[2] + digits[5] + digits[8])) % 10
case digits.size
when 9
if checksum(digits) == 0
return routing_number
else
return routing_number[4..8] + routing_number[1..3]
end
when 8
return routing_number
end
end

return checksum == 0 || CAN_INSTITUTION_NUMBERS.include?(routing_number[1..3])
# Always return electronic-formatted routing number for Canadian routing numbers, US routing numbers unchanged
def electronic_format_routing_number
digits = routing_number.to_s.split('').map(&:to_i).select { |d| (0..9).cover?(d) }
case digits.size
when 9
return routing_number
when 8
return '0' + routing_number[5..7] + routing_number[0..4]
end
false
end
end
end
Expand Down
33 changes: 32 additions & 1 deletion lib/active_merchant/billing/credit_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ module Billing #:nodoc:
# * Olimpica
# * Creditel
# * Confiable
# * Mada
# * BpPlus
# * Passcard
# * Edenred
# * Anda
# * Creditos directos (Tarjeta D)
# * Panal
# * Verve
#
# For testing purposes, use the 'bogus' credit card brand. This skips the vast majority of
# validations, allowing you to focus on your core concerns until you're ready to be more concerned
Expand Down Expand Up @@ -61,6 +69,8 @@ module Billing #:nodoc:
class CreditCard < Model
include CreditCardMethods

BRANDS_WITH_SPACES_IN_NUMBER = %w(bp_plus)

class << self
# Inherited, but can be overridden w/o changing parent's value
attr_accessor :require_verification_value
Expand All @@ -76,7 +86,7 @@ class << self
attr_reader :number

def number=(value)
@number = (empty?(value) ? value : value.to_s.gsub(/[^\d]/, ''))
@number = (empty?(value) ? value : filter_number(value))
end

# Returns or sets the expiry month for the card.
Expand Down Expand Up @@ -116,6 +126,14 @@ def number=(value)
# * +'olimpica'+
# * +'creditel'+
# * +'confiable'+
# * +'mada'+
# * +'bp_plus'+
# * +'passcard'+
# * +'edenred'+
# * +'anda'+
# * +'tarjeta-d'+
# * +'panal'+
# * +'verve'+
#
# Or, if you wish to test your implementation, +'bogus'+.
#
Expand Down Expand Up @@ -337,8 +355,21 @@ def emv?
icc_data.present?
end

def allow_spaces_in_card?(number = nil)
BRANDS_WITH_SPACES_IN_NUMBER.include?(self.class.brand?(self.number || number))
end

private

def filter_number(value)
regex = if allow_spaces_in_card?(value)
/[^\d ]/
else
/[^\d]/
end
value.to_s.gsub(regex, '')
end

def validate_essential_attributes #:nodoc:
errors = []

Expand Down
Loading
Loading