allpay_invoice 0.0.5 → 0.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: cd8fb36c4b1d1b34f34ba1ee17732bed1f659ee3
4
- data.tar.gz: 9eabb39c0314c618f6d67d0654fcb19068abcb23
3
+ metadata.gz: 33e6df43b53d0887ddbb54a41653403f1fc52baf
4
+ data.tar.gz: 3166e0d291595867f341427bdba53c14089b70ed
5
5
  SHA512:
6
- metadata.gz: e444292d141aaca5d7ed06b70a45ddd14f9a60cbaedae8670c8f73b639b23fa425f5e6d5eaee8badaa75a7702d21d5154e3031eac13216a3638628abd809c783
7
- data.tar.gz: 8f89012d123f1cf041081b7a7c162bc3d2bde96e900554b587e24fce55f15f12b02a25f00f5ed407d7fb2108164ce5710408d6cbdeab2c5724b43374bc63645f
6
+ metadata.gz: c8714ca4c6e4340d9155a3824d15b3043dc8c3222df3a2459acf3416db011f8f009968bab565b137fa54709490e0a74cea11e984f03b134c88773f918e0afff9
7
+ data.tar.gz: f3a99bad64299ee17d0f98023a47bfb1b8fbede6e3ef237d21d9e4af01fa1b5d23f949af8e560e03d6f1b5ba38cfbd3c156bff87b66dedc9c7c0eb7ac2f59cdd
data/README.md CHANGED
@@ -23,32 +23,32 @@ Or install it yourself as:
23
23
  ## Usage
24
24
  init:
25
25
 
26
- $ @client = AllpayInvoice::Invoice.new(mode: :test)
26
+ @client = AllpayInvoice::Invoice.new(mode: :test)
27
27
  create new invoice:
28
28
 
29
- $ @client.issue TimeStamp: Time.now.to_i,
30
- RelateNumber: SecureRandom.hex(6),
31
- CustomerIdentifier: '',
32
- CustomerName: 'bird的rspec',
33
- CustomerAddr: 'bird的rspec_address',
34
- CustomerPhone: '',
35
- CustomerEmail: 'bird1204@gmail.com',
36
- ClearanceMark: '',
37
- Print: '1',
38
- Donation: '2',
39
- CarruerType: '',
40
- CarruerNum: '',
41
- TaxType: '1',
42
- SalesAmount: 200,
43
- InvoiceRemark: 'remark備註',
44
- ItemName: '車子1|item2',
45
- ItemCount: '1|1',
46
- ItemWord: '個|份',
47
- ItemPrice: '100|100',
48
- ItemTaxType: '1|1',
49
- ItemAmount: '100|100',
50
- InvType: '07',
51
- InvCreateDate: Time.now.strftime('%Y-%m-%d %H:%M:%S')
29
+ @client.issue TimeStamp: Time.now.to_i,
30
+ RelateNumber: SecureRandom.hex(6),
31
+ CustomerIdentifier: '',
32
+ CustomerName: 'bird的rspec',
33
+ CustomerAddr: 'bird的rspec_address',
34
+ CustomerPhone: '',
35
+ CustomerEmail: 'bird1204@gmail.com',
36
+ ClearanceMark: '',
37
+ Print: '1',
38
+ Donation: '2',
39
+ CarruerType: '',
40
+ CarruerNum: '',
41
+ TaxType: '1',
42
+ SalesAmount: 200,
43
+ InvoiceRemark: 'remark備註',
44
+ ItemName: '車子1|item2',
45
+ ItemCount: '1|1',
46
+ ItemWord: '個|份',
47
+ ItemPrice: '100|100',
48
+ ItemTaxType: '1|1',
49
+ ItemAmount: '100|100',
50
+ InvType: '07',
51
+ InvCreateDate: Time.now.strftime('%Y-%m-%d %H:%M:%S')
52
52
 
53
53
  ## Development
54
54
 
@@ -78,7 +78,7 @@ module AllpayInvoice
78
78
  # url_encode => CustomerEmail / CustomerName / CustomerAddr / ItemName / ItemWord / InvoiceRemark
79
79
  # 在產生 CheckMacValue 時, 須將 ItemName、ItemWord 及 InvoiceRemark 等欄位排除
80
80
  def delay_issue(overwrite_params = {})
81
- res = request '/Invoice/DelayIssue', overwrite_params
81
+ res = request '/Invoice/DelayIssue', generate_params(overwrite_params)
82
82
  Hash[res.body.split('&').map! { |i| i.split('=') }]
83
83
  end
84
84
 
@@ -86,7 +86,7 @@ module AllpayInvoice
86
86
  # url_encode => NotifyMail / ItemName / ItemWord
87
87
  # 在產生 CheckMacValue 時,須將 ItemName 及 ItemWord 等欄位排除
88
88
  def allowance(overwrite_params = {})
89
- res = request '/Invoice/Allowance', overwrite_params
89
+ res = request '/Invoice/Allowance', generate_params(overwrite_params)
90
90
  Hash[res.body.split('&').map! { |i| i.split('=') }]
91
91
  end
92
92
 
@@ -94,7 +94,7 @@ module AllpayInvoice
94
94
  # url_encode => Reason
95
95
  # 在產生 CheckMacValue 時,須將 Reason 欄位排除
96
96
  def issue_invalid(overwrite_params = {})
97
- res = request '/Invoice/IssueInvalid', overwrite_params
97
+ res = request '/Invoice/IssueInvalid', generate_params(overwrite_params)
98
98
  Hash[res.body.split('&').map! { |i| i.split('=') }]
99
99
  end
100
100
 
@@ -102,7 +102,7 @@ module AllpayInvoice
102
102
  # url_encode => Reason
103
103
  # 在產生 CheckMacValue 時,須將 ItemName 及 ItemWord 等欄位排除
104
104
  def allowance_invalid(overwrite_params = {})
105
- res = request '/AllowanceInvalid', overwrite_params
105
+ res = request '/AllowanceInvalid', generate_params(overwrite_params)
106
106
  Hash[res.body.split('&').map! { |i| i.split('=') }]
107
107
  end
108
108
 
@@ -110,7 +110,7 @@ module AllpayInvoice
110
110
  # url_encode => IIS_Customer_Name / IIS_Customer_Addr / ItemName / ItemWord / InvoiceRemark
111
111
  # 在產生 CheckMacValue 時,須將 ItemName、ItemWord 及 InvoiceRemark 等欄位排除
112
112
  def query_issue(overwrite_params = {})
113
- res = request '/Query/Issue', overwrite_params
113
+ res = request '/Query/Issue', generate_params(overwrite_params)
114
114
  Hash[res.body.split('&').map! { |i| i.split('=') }]
115
115
  end
116
116
 
@@ -118,7 +118,7 @@ module AllpayInvoice
118
118
  # url_encode => Reason
119
119
  # 在產生 CheckMacValue 時,須將 Reason 等欄位排除
120
120
  def query_issue_invalid(overwrite_params = {})
121
- res = request '/Query/IssueInvalid', overwrite_params
121
+ res = request '/Query/IssueInvalid', generate_params(overwrite_params)
122
122
  Hash[res.body.split('&').map! { |i| i.split('=') }]
123
123
  end
124
124
 
@@ -126,7 +126,7 @@ module AllpayInvoice
126
126
  # url_encode => ItemName / ItemWord / IIS_Customer_Name
127
127
  # 在產生 CheckMacValue 時,須將 ItemName、ItemWord 等欄位排除
128
128
  def query_allowance(overwrite_params = {})
129
- res = request '/Query/Allowance', overwrite_params
129
+ res = request '/Query/Allowance', generate_params(overwrite_params)
130
130
  Hash[res.body.split('&').map! { |i| i.split('=') }]
131
131
  end
132
132
 
@@ -134,19 +134,19 @@ module AllpayInvoice
134
134
  # url_encode => Reason
135
135
  # 在產生 CheckMacValue 時,須將 Reason 等欄位排除
136
136
  def query_allowance_invalid(overwrite_params = {})
137
- res = request '/Query/AllowanceInvalid', overwrite_params
137
+ res = request '/Query/AllowanceInvalid', generate_params(overwrite_params)
138
138
  Hash[res.body.split('&').map! { |i| i.split('=') }]
139
139
  end
140
140
 
141
141
  # 發送通知API
142
142
  def invoice_notify(overwrite_params = {})
143
- res = request '/Notify/InvoiceNotify', overwrite_params
143
+ res = request '/Notify/InvoiceNotify', generate_params(overwrite_params)
144
144
  Hash[res.body.split('&').map! { |i| i.split('=') }]
145
145
  end
146
146
 
147
147
  # 付款完成觸發或延遲開立發票API
148
148
  def trigger_issue(overwrite_params = {})
149
- res = request '/Invoice/TriggerIssue', overwrite_params
149
+ res = request '/Invoice/TriggerIssue', generate_params(overwrite_params)
150
150
  Hash[res.body.split('&').map! { |i| i.split('=') }]
151
151
  end
152
152
 
@@ -1,3 +1,3 @@
1
1
  module AllpayInvoice
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allpay_invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wei-Yi Chiu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler