miiCardConsumers 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/miiCardConsumers.rb +71 -3
- metadata +3 -2
data/lib/miiCardConsumers.rb
CHANGED
@@ -410,12 +410,61 @@ class FinancialAccount
|
|
410
410
|
end
|
411
411
|
end
|
412
412
|
|
413
|
+
class FinancialCreditCard
|
414
|
+
attr_accessor :account_name, :holder, :account_number, :type, :from_date, :last_updated_utc, :credit_limit
|
415
|
+
attr_accessor :running_balance, :debits_sum, :debits_count, :credits_sum, :credits_count, :currency_iso
|
416
|
+
attr_accessor :transactions
|
417
|
+
|
418
|
+
def initialize(account_name, holder, account_number, type, from_date, last_updated_utc, credit_limit, running_balance, debits_sum, debits_count, credits_sum, credits_count, currency_iso, transactions)
|
419
|
+
@account_name = account_name
|
420
|
+
@holder = holder
|
421
|
+
@account_number = account_number
|
422
|
+
@type = type
|
423
|
+
@from_date = from_date
|
424
|
+
@last_updated_utc = last_updated_utc
|
425
|
+
@credit_limit = credit_limit
|
426
|
+
@running_balance = running_balance
|
427
|
+
@debits_sum = debits_sum
|
428
|
+
@debits_count = debits_count
|
429
|
+
@credits_sum = credits_sum
|
430
|
+
@credits_count = credits_count
|
431
|
+
@currency_iso = currency_iso
|
432
|
+
@transactions = transactions
|
433
|
+
end
|
434
|
+
|
435
|
+
def self.from_hash(hash)
|
436
|
+
transactions = hash["Transactions"]
|
437
|
+
transactions_parsed = nil
|
438
|
+
unless (transactions.nil? || transactions.empty?)
|
439
|
+
transactions_parsed = transactions.map{|item| FinancialTransaction::from_hash(item)}
|
440
|
+
end
|
441
|
+
|
442
|
+
return FinancialCreditCard.new(
|
443
|
+
hash['AccountName'],
|
444
|
+
hash['Holder'],
|
445
|
+
hash['AccountNumber'],
|
446
|
+
hash['Type'],
|
447
|
+
(Util::parse_dot_net_json_datetime(hash['FromDate']) rescue nil),
|
448
|
+
(Util::parse_dot_net_json_datetime(hash['LastUpdatedUtc']) rescue nil),
|
449
|
+
hash['CreditLimit'],
|
450
|
+
hash['RunningBalance'],
|
451
|
+
hash['DebitsSum'],
|
452
|
+
hash['DebitsCount'],
|
453
|
+
hash['CreditsSum'],
|
454
|
+
hash['CreditsCount'],
|
455
|
+
hash['CurrencyIso'],
|
456
|
+
transactions_parsed
|
457
|
+
)
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
413
461
|
class FinancialProvider
|
414
|
-
attr_accessor :provider_name, :financial_accounts
|
462
|
+
attr_accessor :provider_name, :financial_accounts, :financial_credit_cards
|
415
463
|
|
416
|
-
def initialize(provider_name, financial_accounts)
|
464
|
+
def initialize(provider_name, financial_accounts, financial_credit_cards)
|
417
465
|
@provider_name = provider_name
|
418
466
|
@financial_accounts = financial_accounts
|
467
|
+
@financial_credit_cards = financial_credit_cards
|
419
468
|
end
|
420
469
|
|
421
470
|
def self.from_hash(hash)
|
@@ -425,9 +474,16 @@ class FinancialProvider
|
|
425
474
|
accounts_parsed = accounts.map{|item| FinancialAccount::from_hash(item)}
|
426
475
|
end
|
427
476
|
|
477
|
+
credit_cards = hash["FinancialCreditCards"]
|
478
|
+
credit_cards_parsed = nil
|
479
|
+
unless (credit_cards.nil? || credit_cards.empty?)
|
480
|
+
credit_cards_parsed = credit_cards.map{|item| FinancialCreditCard::from_hash(item)}
|
481
|
+
end
|
482
|
+
|
428
483
|
return FinancialProvider.new(
|
429
484
|
hash['ProviderName'],
|
430
|
-
accounts_parsed
|
485
|
+
accounts_parsed,
|
486
|
+
credit_cards_parsed
|
431
487
|
)
|
432
488
|
end
|
433
489
|
end
|
@@ -757,13 +813,25 @@ class MiiCardOAuthFinancialService < MiiCardOAuthServiceBase
|
|
757
813
|
return make_request(get_method_url('IsRefreshInProgress'), nil, nil, true)
|
758
814
|
end
|
759
815
|
|
816
|
+
def is_refresh_in_progress_credit_cards
|
817
|
+
return make_request(get_method_url('IsRefreshInProgressCreditCards'), nil, nil, true)
|
818
|
+
end
|
819
|
+
|
760
820
|
def refresh_financial_data
|
761
821
|
return make_request(get_method_url('RefreshFinancialData'), nil, FinancialRefreshStatus.method(:from_hash), true)
|
762
822
|
end
|
763
823
|
|
824
|
+
def refresh_financial_data_credit_cards
|
825
|
+
return make_request(get_method_url('RefreshFinancialDataCreditCards'), nil, FinancialRefreshStatus.method(:from_hash), true)
|
826
|
+
end
|
827
|
+
|
764
828
|
def get_financial_transactions
|
765
829
|
return make_request(get_method_url('GetFinancialTransactions'), nil, MiiFinancialData.method(:from_hash), true)
|
766
830
|
end
|
831
|
+
|
832
|
+
def get_financial_transactions_credit_cards
|
833
|
+
return make_request(get_method_url('GetFinancialTransactionsCreditCards'), nil, MiiFinancialData.method(:from_hash), true)
|
834
|
+
end
|
767
835
|
end
|
768
836
|
|
769
837
|
class MiiCardDirectoryService
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miiCardConsumers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Paul O'Neill
|
9
|
+
- Peter Sanderson
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date:
|
13
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: oauth
|