alpha_card 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/alpha_card.gemspec +5 -1
- data/lib/alpha_card.rb +6 -1
- data/lib/alpha_card/shipping.rb +18 -0
- data/lib/alpha_card/version.rb +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ceec62767933ce8b3848b21ec0ffbe6c9775f229
|
4
|
+
data.tar.gz: 82c414eea55aa6d675d0c1043cba408eb21af70a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac21d71195b11f35c375c1ea0743cf033f33e81eaa61ce639fdc5aedecf6ac5450ad139527233e18484fdb0a1ebccb223d843ef296a6b416318f84f16d547e2
|
7
|
+
data.tar.gz: 3e713b2ccbd597e73a1f4c6bcc0faedab7e49e5fb9ec3319b3812d34c8fd74d1ecf3c3e78464df9c34bce9815f6daacc5c474caefca33a887cf7b8b4b613569e
|
data/alpha_card.gemspec
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'lib'))
|
2
|
+
|
3
|
+
require 'alpha_card/version'
|
4
|
+
|
1
5
|
Gem::Specification.new do |gem|
|
2
6
|
gem.name = 'alpha_card'
|
3
|
-
gem.version =
|
7
|
+
gem.version = AlphaCard::VERSION
|
4
8
|
gem.date = '2014-07-11'
|
5
9
|
gem.summary = 'Alpha Card Services DirectPost API for Ruby'
|
6
10
|
gem.description = 'Gem for creating sales with Alpha Card Services DirectPost API'
|
data/lib/alpha_card.rb
CHANGED
@@ -3,13 +3,18 @@ require 'yaml'
|
|
3
3
|
require 'virtus'
|
4
4
|
require 'rest_client'
|
5
5
|
|
6
|
+
# Version
|
7
|
+
require 'alpha_card/version'
|
8
|
+
|
6
9
|
require 'alpha_card/utils'
|
7
10
|
require 'alpha_card/alpha_card_object'
|
8
11
|
require 'alpha_card/alpha_card_response'
|
9
12
|
|
13
|
+
# Errors
|
10
14
|
require 'alpha_card/errors/alpha_card_error'
|
11
15
|
require 'alpha_card/errors/api_connection_error'
|
12
16
|
|
17
|
+
# Alpha Card Resources
|
13
18
|
require 'alpha_card/account'
|
14
19
|
require 'alpha_card/shipping'
|
15
20
|
require 'alpha_card/billing'
|
@@ -30,7 +35,7 @@ module AlphaCard
|
|
30
35
|
CREDIT_CARD_CODES ||= YAML.load_file(File.expand_path('../alpha_card/data/credit_card_codes.yml', __FILE__))
|
31
36
|
|
32
37
|
class << self
|
33
|
-
|
38
|
+
# @return [String] Alpha Card Gateway DirectPost API URL.
|
34
39
|
attr_accessor :api_base
|
35
40
|
end
|
36
41
|
|
data/lib/alpha_card/shipping.rb
CHANGED
@@ -13,5 +13,23 @@ module AlphaCard
|
|
13
13
|
attribute :zip_code, String
|
14
14
|
attribute :country, String
|
15
15
|
attribute :email, String
|
16
|
+
|
17
|
+
##
|
18
|
+
# Overloaded <code>filled_attributes</code> method from
|
19
|
+
# <code>AlphaCard::AlphaCardObject</code>. All attributes of
|
20
|
+
# the Alpha Card Shipping object must start with "shipping_"
|
21
|
+
# prefix.
|
22
|
+
#
|
23
|
+
# @return [Hash] attributes
|
24
|
+
# Only filled attributes of Shipping resource with "shipping_" prefix.
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# shipping = AlphaCard::Shipping.new({firstname: 'John', state: 'NY'})
|
28
|
+
# shipping.filled_attributes
|
29
|
+
#
|
30
|
+
# #=> {shipping_firstname: 'John', shipping_state: 'NY'}
|
31
|
+
def filled_attributes
|
32
|
+
Hash[super.map {|k, v| ["shipping_#{k}".to_sym, v] }]
|
33
|
+
end
|
16
34
|
end
|
17
35
|
end
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Bulaj
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/alpha_card/sale.rb
|
79
79
|
- lib/alpha_card/shipping.rb
|
80
80
|
- lib/alpha_card/utils.rb
|
81
|
+
- lib/alpha_card/version.rb
|
81
82
|
- spec/alpha_card/alpha_card_account_spec.rb
|
82
83
|
- spec/alpha_card/alpha_card_response_spec.rb
|
83
84
|
- spec/alpha_card/alpha_card_spec.rb
|