cayan 1.0.0 → 1.1.0

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: a1ad0c2d4a7cd5c5024c36d6c7c8ce296baa1d21
4
- data.tar.gz: 6b3ed7615e87ff6dbcd52c6eaf68188b36d741c3
3
+ metadata.gz: 40a70aad77f5b858edc7c5088e3690c571d73882
4
+ data.tar.gz: 5e1734113a3d38ed6bc4e4ad36d54291797077f1
5
5
  SHA512:
6
- metadata.gz: 984ea5e07dade7578602ef435fe499d5bfc575fd7d4c2ba6727d16538a801309a009d345dfc9611125321a816b7d5c5d2cede3723b92cc30deb9b03b5df58942
7
- data.tar.gz: '043878344d08b98d8436179ab93bfbd9b657c2f4bc145f524beae2903c2d03d4bb75c654d61f4aa3c7cf861ca96ffdf9fd1f807071340d2e45a7eafcf7be34d4'
6
+ metadata.gz: 1363677042efe5555fe8aca0bba2882307824ef32477025d5e82ed2961e1047eb66c6bc2061b10b00610b86f73ff18931b74c1b4d9b969b99d506020a42c00ad
7
+ data.tar.gz: d4dc2a72628f504d193f3584f8ea19cd52d12c1b11bce363f34d1c1d8a994de0031952b4f22fed6ed40b297b103a99948958540c4dd9e8feeb01b440d838998f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cayan (0.1.0)
4
+ cayan (1.0.0)
5
5
  savon (~> 2.12.0)
6
6
 
7
7
  GEM
@@ -33,7 +33,7 @@ GEM
33
33
  method_source (0.9.0)
34
34
  mini_portile2 (2.3.0)
35
35
  minitest (5.11.3)
36
- nokogiri (1.8.4)
36
+ nokogiri (1.8.5)
37
37
  mini_portile2 (~> 2.3.0)
38
38
  nori (2.6.0)
39
39
  pry (0.11.3)
data/README.md CHANGED
@@ -4,6 +4,7 @@ A Ruby gem for talking to the Cayan Merchantware API
4
4
 
5
5
  [![Build Status](https://travis-ci.com/cohubinc/cayan-ruby.svg?branch=master)](https://travis-ci.com/cohubinc/cayan-ruby)
6
6
  [![Coverage Status](https://coveralls.io/repos/github/cohubinc/cayan-ruby/badge.svg?branch=master)](https://coveralls.io/github/cohubinc/cayan-ruby?branch=master)
7
+ [![Gem Version](https://badge.fury.io/rb/cayan.svg)](https://badge.fury.io/rb/cayan)
7
8
 
8
9
  ## Installation (not published yet)
9
10
 
@@ -1,4 +1,5 @@
1
1
  require 'cayan/merchantware/credit/client'
2
+ require 'cayan/merchantware/reports/client'
2
3
 
3
4
  # module Cayan
4
5
  # module Merchantware
@@ -0,0 +1,72 @@
1
+ require 'savon'
2
+
3
+ module Cayan
4
+ module Merchantware
5
+ module Reports
6
+ class Client
7
+ @client = nil
8
+ attr_accessor :credentials
9
+
10
+ def initialize(credentials)
11
+ @credentials = credentials
12
+ @client = Savon.client(
13
+ wsdl: 'https://ps1.merchantware.net/Merchantware/ws/TransactionHistory/v4/Reporting.asmx?WSDL',
14
+ convert_request_keys_to: :camelcase
15
+ )
16
+ end
17
+
18
+ def current_batch_summary(filters)
19
+ response = @client.call(:current_batch_summary, message: credentials.merge(filters))
20
+
21
+ response.body[:current_batch_summary_response][:current_batch_summary_result]
22
+ end
23
+
24
+ def current_batch_transactions
25
+ response = @client.call(:current_batch_transactions, message: credentials)
26
+
27
+ response.body[:current_batch_transactions_response][:current_batch_transactions_result]
28
+ end
29
+
30
+ def summary_by_date(filters)
31
+ response = @client.call(:summary_by_date, message: credentials.merge(filters))
32
+
33
+ response.body[:summary_by_date_response][:summary_by_date_result]
34
+ end
35
+
36
+ def transactions_by_date(filters)
37
+ response = @client.call(:transactions_by_date, message: credentials.merge(filters))
38
+
39
+ response.body[:transactions_by_date_response][:transactions_by_date_result]
40
+ end
41
+
42
+ def transactions_by_reference(filters)
43
+ response = @client.call(:transactions_by_date, message: credentials.merge(filters))
44
+
45
+ response.body[:transactions_by_reference_response][:transactions_by_reference_result]
46
+ end
47
+
48
+ def transactions_by_transaction_id(transaction_id)
49
+ response = @client.call(:detailed_transaction_by_transaction_id, message: credentials.merge({
50
+ merchant_transaction_id: transaction_id
51
+ }))
52
+
53
+ response.body[:transactions_by_transaction_id_response][:transactions_by_transaction_id_result]
54
+ end
55
+
56
+ def detailed_transaction_by_reference(filters)
57
+ response = @client.call(:detailed_transaction_by_reference, message: credentials.merge(filters))
58
+
59
+ response.body[:detailed_transaction_by_reference_response][:detailed_transaction_by_reference_result]
60
+ end
61
+
62
+ def detailed_transaction_by_transaction_id(transaction_id)
63
+ response = @client.call(:detailed_transaction_by_transaction_id, message: credentials.merge({
64
+ merchant_transaction_id: transaction_id
65
+ }))
66
+
67
+ response.body[:detailed_transaction_by_transaction_id_response][:detailed_transaction_by_transaction_id_result]
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
data/lib/cayan/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cayan
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cayan
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cohub, Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-26 00:00:00.000000000 Z
11
+ date: 2018-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -114,6 +114,7 @@ files:
114
114
  - lib/cayan.rb
115
115
  - lib/cayan/merchantware.rb
116
116
  - lib/cayan/merchantware/credit/client.rb
117
+ - lib/cayan/merchantware/reports/client.rb
117
118
  - lib/cayan/version.rb
118
119
  homepage: https://github.com/cohubinc/cayan-ruby
119
120
  licenses: []