alpha_card 0.2.3 → 0.2.4
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 +4 -4
- data/.travis.yml +3 -0
- data/README.md +7 -11
- data/alpha_card.gemspec +3 -3
- data/lib/alpha_card.rb +6 -6
- data/lib/alpha_card/{account.rb → objects/account.rb} +0 -0
- data/lib/alpha_card/{billing.rb → objects/billing.rb} +0 -0
- data/lib/alpha_card/{order.rb → objects/order.rb} +0 -0
- data/lib/alpha_card/{sale.rb → objects/sale.rb} +0 -0
- data/lib/alpha_card/{shipping.rb → objects/shipping.rb} +0 -0
- data/lib/alpha_card/version.rb +1 -1
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36744d2c2e89bb5acb72ae8da81b9a5c684e5d2d
|
4
|
+
data.tar.gz: 1b402affc8aa94c7f20ea1895f2744c265d48296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15f2fe0c1206ff43f976ab80564944aad992e70fc61e4e7cabac1fccbe05f3afe08c1cbf4e8375bbf44bedf328b007e7528bf674e10e730f28ebb605acf9e700
|
7
|
+
data.tar.gz: 60d5b8edd45ede8faed993f8aaaf99d335349d71803b9c519b41861d50318f99690e9151ee8248dbcea727f7ae68fe2b0ecdbb408c86e8ecbb244071925648e1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Ruby lib for creating payments with
|
1
|
+
# Ruby lib for creating payments with Alpha Card Services
|
2
2
|
[](http://badge.fury.io/rb/alpha_card)
|
3
3
|
[](https://gemnasium.com/budev/alpha_card)
|
4
4
|
[](https://codeclimate.com/github/budev/alpha_card)
|
@@ -38,15 +38,13 @@ gem install alpha_card
|
|
38
38
|
Dependencies required:
|
39
39
|
|
40
40
|
* ruby >= 1.9.3;
|
41
|
-
* rest_client;
|
42
|
-
* virtus (for nice OOP objects of AlphaCard).
|
43
41
|
|
44
42
|
|
45
43
|
## Alpha Card Objects
|
46
44
|
|
47
|
-
Alpha Card
|
45
|
+
Alpha Card operates with next 5 objects:
|
48
46
|
|
49
|
-
* Account
|
47
|
+
* Account (represent your Alpha Card credentials)
|
50
48
|
* Order
|
51
49
|
- Billing
|
52
50
|
- Shipping
|
@@ -178,15 +176,13 @@ require 'alpha_card'
|
|
178
176
|
def create_payment
|
179
177
|
account = AlphaCard::Account.new('demo', 'password')
|
180
178
|
|
181
|
-
billing = AlphaCard::Billing.new({email: 'test@example.com', phone: '+801311313111'})
|
182
|
-
shipping = AlphaCard::Shipping.new({address_1: '33 N str', city: 'New York', state: 'NY', zip_code: '132'})
|
179
|
+
billing = AlphaCard::Billing.new({ email: 'test@example.com', phone: '+801311313111' })
|
180
|
+
shipping = AlphaCard::Shipping.new({ address_1: '33 N str', city: 'New York', state: 'NY', zip_code: '132' })
|
183
181
|
|
184
|
-
order = AlphaCard::Order.new({orderid: 1, orderdescription: 'Test order'})
|
185
|
-
order.billing = billing
|
186
|
-
order.shipping = shipping
|
182
|
+
order = AlphaCard::Order.new({ orderid: 1, orderdescription: 'Test order' })
|
187
183
|
|
188
184
|
# Format of amount: "XX.XX" ("%.2f" % Float)
|
189
|
-
sale = AlphaCard::Sale.new({ccexp: '0117', ccnumber: '4111111111111111', amount: "1.50", cvv: '123'})
|
185
|
+
sale = AlphaCard::Sale.new({ ccexp: '0117', ccnumber: '4111111111111111', amount: "1.50", cvv: '123' })
|
190
186
|
sale.create(order, account)
|
191
187
|
rescue AlphaCard::AlphaCardError => e
|
192
188
|
puts e.message
|
data/alpha_card.gemspec
CHANGED
@@ -6,13 +6,13 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.name = 'alpha_card'
|
7
7
|
gem.version = AlphaCard::VERSION
|
8
8
|
gem.date = '2014-07-24'
|
9
|
-
gem.summary = 'Alpha Card Services
|
10
|
-
gem.description = 'Gem for creating sales with Alpha Card Services
|
9
|
+
gem.summary = 'Alpha Card Services API for Ruby'
|
10
|
+
gem.description = 'Gem for creating sales with Alpha Card Services'
|
11
11
|
gem.authors = ['Nikita Bulaj']
|
12
12
|
gem.email = 'bulajnikita@gmail.com'
|
13
13
|
gem.require_paths = ['lib']
|
14
14
|
gem.files = `git ls-files`.split($RS)
|
15
|
-
gem.homepage = 'http://github.com/
|
15
|
+
gem.homepage = 'http://github.com/nbulaj/alpha_card'
|
16
16
|
gem.license = 'MIT'
|
17
17
|
gem.required_ruby_version = '>= 1.9.3'
|
18
18
|
|
data/lib/alpha_card.rb
CHANGED
@@ -15,11 +15,11 @@ require 'alpha_card/errors/alpha_card_error'
|
|
15
15
|
require 'alpha_card/errors/api_connection_error'
|
16
16
|
|
17
17
|
# Alpha Card Resources
|
18
|
-
require 'alpha_card/account'
|
19
|
-
require 'alpha_card/shipping'
|
20
|
-
require 'alpha_card/billing'
|
21
|
-
require 'alpha_card/order'
|
22
|
-
require 'alpha_card/sale'
|
18
|
+
require 'alpha_card/objects/account'
|
19
|
+
require 'alpha_card/objects/shipping'
|
20
|
+
require 'alpha_card/objects/billing'
|
21
|
+
require 'alpha_card/objects/order'
|
22
|
+
require 'alpha_card/objects/sale'
|
23
23
|
|
24
24
|
##
|
25
25
|
# AlphaCard is a library for processing payments with Alpha Card Services, Inc.
|
@@ -32,7 +32,7 @@ module AlphaCard
|
|
32
32
|
# Global Payment Systems (NDC) Credit Card Authorization Codes
|
33
33
|
#
|
34
34
|
# @see http://floristwiki.ftdi.com/images/c/ce/Appendix_A_-_Credit_Card_Authorization_Codes.pdf Credit Card Authorization Codes
|
35
|
-
CREDIT_CARD_CODES
|
35
|
+
CREDIT_CARD_CODES = YAML.load_file(File.expand_path('../alpha_card/data/credit_card_codes.yml', __FILE__))
|
36
36
|
|
37
37
|
class << self
|
38
38
|
# @return [String] Alpha Card Gateway DirectPost API URL.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/alpha_card/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alpha_card
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Bulaj
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3'
|
55
|
-
description: Gem for creating sales with Alpha Card Services
|
55
|
+
description: Gem for creating sales with Alpha Card Services
|
56
56
|
email: bulajnikita@gmail.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|
@@ -67,16 +67,16 @@ files:
|
|
67
67
|
- Rakefile
|
68
68
|
- alpha_card.gemspec
|
69
69
|
- lib/alpha_card.rb
|
70
|
-
- lib/alpha_card/account.rb
|
71
70
|
- lib/alpha_card/alpha_card_object.rb
|
72
71
|
- lib/alpha_card/alpha_card_response.rb
|
73
|
-
- lib/alpha_card/billing.rb
|
74
72
|
- lib/alpha_card/data/credit_card_codes.yml
|
75
73
|
- lib/alpha_card/errors/alpha_card_error.rb
|
76
74
|
- lib/alpha_card/errors/api_connection_error.rb
|
77
|
-
- lib/alpha_card/
|
78
|
-
- lib/alpha_card/
|
79
|
-
- lib/alpha_card/
|
75
|
+
- lib/alpha_card/objects/account.rb
|
76
|
+
- lib/alpha_card/objects/billing.rb
|
77
|
+
- lib/alpha_card/objects/order.rb
|
78
|
+
- lib/alpha_card/objects/sale.rb
|
79
|
+
- lib/alpha_card/objects/shipping.rb
|
80
80
|
- lib/alpha_card/utils.rb
|
81
81
|
- lib/alpha_card/version.rb
|
82
82
|
- spec/alpha_card/alpha_card_account_spec.rb
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- spec/alpha_card/alpha_card_spec.rb
|
85
85
|
- spec/alpha_card/alpha_card_utils_spec.rb
|
86
86
|
- spec/spec_helper.rb
|
87
|
-
homepage: http://github.com/
|
87
|
+
homepage: http://github.com/nbulaj/alpha_card
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata: {}
|
@@ -104,9 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.4.3
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
|
-
summary: Alpha Card Services
|
110
|
+
summary: Alpha Card Services API for Ruby
|
111
111
|
test_files: []
|
112
|
-
has_rdoc:
|