paysafe 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d6bbfa2b88d67e16221b48a7fdc9e2048f3e83e2
4
- data.tar.gz: f4e8670f77a2ca5a406b5a52794a446f87f2dabe
3
+ metadata.gz: 1371212d079af59b921be49fad80577c32e64e1b
4
+ data.tar.gz: 7333f94629ab3e9e6f014c6648d9c8bff1d0de3f
5
5
  SHA512:
6
- metadata.gz: dd143b165e5467ae27d084c9011ce710d80dd40eff19fbd2896a4514b6a3d1dff4ccefea27ee533aa05b2c37825970a3644bd7cd14111ec313ba4192fdd725f6
7
- data.tar.gz: f577618983eaa4dc510f5fa4def95780be2c85c8ec791d35ea8c300018acbc56780f3f58a7fbf6e5c0558e9ce6d8114cc5fc89c7c8b96d34b69ce77b2205eeb0
6
+ metadata.gz: 4e823f1ad04a9856ca4d239e759c0ab387d45fe10a5fb573e1f776df52973cec1d1ec1f30e783f8ada52c62989c2ab429d5232087df1672f31312f77448b16ad
7
+ data.tar.gz: 76a5f749b30e0b796bc986e078ab23a8484c17fa672b6b90fce70551e4b3b676848abae5aa9bd365c97401c583f53af9393b16c2c2c52dddfb13f571aea29a26
@@ -1,6 +1,10 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 0.9.1 (2017-04-24)
5
+
6
+ * Added `card.brand` method that converts `card_type` value (VI) to brand name (visa).
7
+
4
8
  ## 0.9.0 (2017-04-19)
5
9
 
6
10
  This is a major update with breaking changes so moving the version up quite a bit since I'd also like to move to a 1.0 release soon after.
@@ -2,6 +2,21 @@ require 'paysafe/result'
2
2
 
3
3
  module Paysafe
4
4
  class Card < Result
5
+
6
+ BRANDS = {
7
+ 'AM' => 'american_express',
8
+ 'DC' => 'diners_club',
9
+ 'DI' => 'discover',
10
+ 'JC' => 'jcb',
11
+ 'MC' => 'master',
12
+ 'MD' => 'maestro',
13
+ 'SF' => 'swiff',
14
+ 'SO' => 'solo',
15
+ 'VI' => 'visa',
16
+ 'VD' => 'visa_debit',
17
+ 'VE' => 'visa_electron',
18
+ }
19
+
5
20
  attributes :id, :nick_name, :merchant_ref_num, :holder_name,
6
21
  :card_num, :card_bin, :last_digits, :card_type, :billing_address_id,
7
22
  :default_card_indicator, :payment_token, :single_use_token, :status,
@@ -9,5 +24,9 @@ module Paysafe
9
24
 
10
25
  object_attribute :CardExpiry, :card_expiry
11
26
  object_attribute :Address, :billing_address
27
+
28
+ def brand
29
+ @brand ||= BRANDS[card_type] || BRANDS[type]
30
+ end
12
31
  end
13
32
  end
@@ -1,3 +1,3 @@
1
1
  module Paysafe
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paysafe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-19 00:00:00.000000000 Z
11
+ date: 2017-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http