rock_rms 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b138e9053889c124d19cf9b08813c98e4ab349af
4
- data.tar.gz: ccf7ffca0eb104a29e9c507c14d1741820f563d4
3
+ metadata.gz: 514de0ec32fa96166e279cdf6e49215a7d624b6a
4
+ data.tar.gz: 15f69b870070433905f4bb35b48392dd2649c6f7
5
5
  SHA512:
6
- metadata.gz: 542c57d9f524ad0dd05d96cf2ecb65adf550cf5802c277cae8ea8b71de5684a075d4117a96e958e874f2159466eb37b9217734fb1e7398e31a54be830decf891
7
- data.tar.gz: 8662b0555342df30e24af02488c47507f2a0c86b521b868bd98056832991f45bf6bc3e1dd76ec76eee1290b1fd51a2759ebbbeef01237b7a51211bff914cca41
6
+ metadata.gz: 0b42adaf40fd595e89e941ad174c410bc9e7e508adac4f4aed40b3811cfe02254956efd6ca1ea63865c9cb9eb96a8350c3666fe2a7039b63dad36adbc338432c
7
+ data.tar.gz: 3ed86f2a15a85b89f28c9af76348e1dbadb2ca0ae0ddeecf2dfe2a4abf5f0bbcc390a3f55725d45c455a5ace26606210eadd8f5397efed30116feeb1966f3b92
@@ -9,7 +9,7 @@ module FaradayMiddleware
9
9
  def on_complete(env)
10
10
  case env[:status]
11
11
  when ERROR_STATUSES
12
- raise Closeio::Error, "#{env.status}: #{env.body}"
12
+ raise RockRMS::Error, "#{env.status}: #{env.body}"
13
13
  end
14
14
  end
15
15
  end
@@ -17,17 +17,19 @@ module RockRMS
17
17
  RockRMS::Donation.format(res)
18
18
  end
19
19
 
20
- def create_donation(payment_type:, authorized_person_id:, amount:, date:, fund_id:, batch_id:)
20
+ def create_donation(payment_type:, authorized_person_id:, amount:, date:, fund_id:, batch_id:, transaction_code: nil)
21
21
  options = {
22
- "TransactionDateTime" => date,
23
22
  "AuthorizedPersonAliasId" => authorized_person_id,
23
+ "BatchId" => batch_id,
24
+ "FinancialPaymentDetailId" => payment_type,
25
+ "TransactionCode" => transaction_code,
26
+ "TransactionDateTime" => date,
24
27
  "TransactionDetails" => [{
25
28
  "Amount" => amount,
26
29
  "AccountId" => fund_id,
27
30
  }],
28
- "TransactionTypeValueId" => 53, # transaction type "contribution", "registration"
29
- "FinancialPaymentDetailId" => payment_type,
30
- "BatchId" => batch_id
31
+ "TransactionTypeValueId" => 53, # contribution, registration
32
+ "SourceTypeValueId" => 10, # website, kiosk, mobile app
31
33
  }
32
34
  post(transaction_path, options)
33
35
  end
@@ -6,6 +6,19 @@ module RockRMS
6
6
  get(payment_method_path, options)
7
7
  end
8
8
 
9
+ def create_payment_method(uuid:, person_id:, last_4:, payment_type:, name:)
10
+ opts = {
11
+ "PersonAliasId" => person_id,
12
+ "Name" => name,
13
+ "ForeignKey" => uuid,
14
+ "FinancialPaymentDetail" => {
15
+ "AccountNumberMasked" => last_4,
16
+ "CurrencyTypeValueId" => payment_type == 'card' ? 156 : 157,
17
+ }
18
+ }
19
+ post("FinancialPersonSavedAccounts", opts)
20
+ end
21
+
9
22
  private
10
23
 
11
24
  def payment_method_path(id = nil)
@@ -1,3 +1,3 @@
1
1
  module RockRMS
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rock_rms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-07 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.4.8
129
+ rubygems_version: 2.6.8
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: A Ruby wrapper for the Rock RMS API