mandarin-api 0.0.10 → 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: b0cc4f937ed0ff217d1bbc45f7c4e093939f52b9
4
- data.tar.gz: 21987910a33fa8cd06069b2165db455a06ac829b
3
+ metadata.gz: 920442acd7bf7f079e9457ee033df0f6ea7d74c3
4
+ data.tar.gz: a6b93d6e006593ec8c27492de8c2587cade92d90
5
5
  SHA512:
6
- metadata.gz: 0d019fc0d93105b39b98b9f8663fee60cf8ed3bdbd8e22de9fd298957710a7ba8ee792057095ba26f7b7487f2f09ef8762b63d973ebf7aaf8b3fa2f4a33e9472
7
- data.tar.gz: 041f932ba4061b457fbbce2e8d85c34a871ea9a081540fa6bc5675c467333ce97fbd579aaaf024585b9fb133e531d2d46b68a59242e326da6d2930ee39865703
6
+ metadata.gz: 7286337650eac5c940f9e68488a80505ba208ade8fe88e7beb8cdf789fce6742a06dd0f314f0bf62969001d17b02fffd8f436968f1469cd31314cf7a9d4c2fed
7
+ data.tar.gz: dd9ddd01f363b14ce9b6ee70f5b0453f3534e74f692c6efb2c68b8c7c0817eec2b4ae63c1bcdaebd379fa010ddad33b8655533ce01c255c59d91e591671172fa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mandarin-api (0.0.10)
4
+ mandarin-api (0.1.0)
5
5
  rest-client (>= 2.0, < 3.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -81,8 +81,15 @@ MandarinApi.charge(order_id, amount, user)
81
81
  ```
82
82
  `user` should be an instance or a Struct, and should respond to `#email` and `#phone` methods
83
83
  `#phone` should be serialized, for example '+79091234567' is correctly serialized number.
84
- `#assign_card` will return a hash.
85
-
84
+ `#charge` will return a hash.
85
+ ###**Example:**
86
+ ```ruby
87
+ {
88
+ "id": "43913ddc000c4d3990fddbd3980c1725",
89
+ "userWebLink": "https://secure.mandarinpay.com/Pay' \
90
+ '?transaction=0eb51e74-e704-4c36-b5cb-8f0227621518"
91
+ }
92
+ ```
86
93
 
87
94
  ###**Example of performing refund:**
88
95
  ```ruby
@@ -22,7 +22,11 @@ module MandarinApi
22
22
  private
23
23
 
24
24
  def phone(user)
25
- '+' + user.phone.gsub(/[^\d]+/, '').gsub(/^8/, '7')
25
+ if user.phone.nil?
26
+ '+70000000000'
27
+ else
28
+ '+' + user.phone.gsub(/[^\d]+/, '').gsub(/^8/, '7')
29
+ end
26
30
  end
27
31
  end
28
32
  end
data/mandarin-api.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'mandarin-api'
4
- s.version = '0.0.10'
4
+ s.version = '0.1.0'
5
5
  s.authors = ['Vladimir Bogaevsky']
6
6
  s.email = 'gitvbogaevsky@gmail.com'
7
7
  s.licenses = ['MIT']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandarin-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Bogaevsky