cloud_payments 1.0.1 → 1.0.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04fb941f12526716bc4134db20ccbde6b973f1f0cbd4cbdedb16f61a0a832907
|
4
|
+
data.tar.gz: 195b80061bb94786f2520491a72d7ae3e01310309fcc2ff23ef656d82de494ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84362d280a6c6f40e2929f88a2b2d0a30b24f1e544538fb9de349bc57fc4a9dde44fc3228d937063e3a991e0bd73f378eecb1da1dccfe18013f0d8b01cd6217b
|
7
|
+
data.tar.gz: ebe23ab42b51850c0eb6836dc8edd52f79c94fa63da8396f91cf440e05c1a6941b79145946609294f2f92519761e11f43dcd7f68727600f0eee0137e234ff3fa
|
data/README.md
CHANGED
@@ -145,6 +145,27 @@ CloudPayments.client.kassa.receipt({
|
|
145
145
|
})
|
146
146
|
```
|
147
147
|
|
148
|
+
## Apple Pay Start Session
|
149
|
+
[Start Apple Pay session](https://developers.cloudpayments.ru/#zapusk-sessii-dlya-oplaty-cherez-apple-pay)
|
150
|
+
```ruby
|
151
|
+
CloudPayments.client.apple_pay.start_session({validation_url: "https://apple-pay-gateway-pr-pod2.apple.com/paymentservices/startSession"})
|
152
|
+
# => {
|
153
|
+
# :message => nil,
|
154
|
+
# :model => {
|
155
|
+
# :display_name => "example.com,
|
156
|
+
# :domain_name => "example.com",
|
157
|
+
# :epoch_timestamp => 1594072416294,
|
158
|
+
# :expires_at => 1594076016294,
|
159
|
+
# :merchant_identifier => "5DCCE3A52CFC3FAF9F4EA8421472E47BC503E03051B04D2ED67A3834386B52F2",
|
160
|
+
# :merchant_session_identifier => "SSHDA3C703BD69B45EDB8934E6BFCC159B2B83AAFC02DB625F1F1E3997CCC2FE2CFD11F636558",
|
161
|
+
# :nonce => "51c77142",
|
162
|
+
# :signature => "30800.....0"
|
163
|
+
# },
|
164
|
+
# :success => true
|
165
|
+
# }
|
166
|
+
|
167
|
+
```
|
168
|
+
|
148
169
|
## Webhooks
|
149
170
|
|
150
171
|
```ruby
|
@@ -6,6 +6,7 @@ require 'cloud_payments/namespaces/payments'
|
|
6
6
|
require 'cloud_payments/namespaces/subscriptions'
|
7
7
|
require 'cloud_payments/namespaces/orders'
|
8
8
|
require 'cloud_payments/namespaces/kassa'
|
9
|
+
require 'cloud_payments/namespaces/apple_pay'
|
9
10
|
|
10
11
|
module CloudPayments
|
11
12
|
module Namespaces
|
@@ -25,6 +26,10 @@ module CloudPayments
|
|
25
26
|
Orders.new(self)
|
26
27
|
end
|
27
28
|
|
29
|
+
def apple_pay
|
30
|
+
ApplePay.new(self)
|
31
|
+
end
|
32
|
+
|
28
33
|
def ping
|
29
34
|
!!(perform_request('/test').body || {})[:success]
|
30
35
|
rescue ::Faraday::ConnectionFailed, ::Faraday::TimeoutError, CloudPayments::Client::ServerError => e
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module CloudPayments
|
3
|
+
module Namespaces
|
4
|
+
class ApplePay < Base
|
5
|
+
ValidationUrlMissing = Class.new(StandardError)
|
6
|
+
|
7
|
+
def self.resource_name
|
8
|
+
'applepay'
|
9
|
+
end
|
10
|
+
|
11
|
+
def start_session(attributes)
|
12
|
+
validation_url = attributes.fetch(:validation_url) { raise ValidationUrlMissing.new('validation_url is required') }
|
13
|
+
|
14
|
+
request(:startsession, { "ValidationUrl" => validation_url })
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
# frozen_string_literal: true
|
4
|
+
require 'spec_helper'
|
5
|
+
|
6
|
+
describe CloudPayments::Namespaces::ApplePay do
|
7
|
+
subject{ described_class.new(CloudPayments.client) }
|
8
|
+
|
9
|
+
describe '#receipt' do
|
10
|
+
let(:attributes) do
|
11
|
+
{
|
12
|
+
validation_url: ''
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
context do
|
17
|
+
before{ attributes.delete(:validation_url) }
|
18
|
+
specify{ expect{subject.start_session(attributes)}.to raise_error(described_class::ValidationUrlMissing) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_payments
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- undr
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/cloud_payments/models/subscription.rb
|
120
120
|
- lib/cloud_payments/models/transaction.rb
|
121
121
|
- lib/cloud_payments/namespaces.rb
|
122
|
+
- lib/cloud_payments/namespaces/apple_pay.rb
|
122
123
|
- lib/cloud_payments/namespaces/base.rb
|
123
124
|
- lib/cloud_payments/namespaces/cards.rb
|
124
125
|
- lib/cloud_payments/namespaces/kassa.rb
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- spec/cloud_payments/models/secure3d_spec.rb
|
135
136
|
- spec/cloud_payments/models/subscription_spec.rb
|
136
137
|
- spec/cloud_payments/models/transaction_spec.rb
|
138
|
+
- spec/cloud_payments/namespaces/apple_pay_spec.rb
|
137
139
|
- spec/cloud_payments/namespaces/base_spec.rb
|
138
140
|
- spec/cloud_payments/namespaces/cards_spec.rb
|
139
141
|
- spec/cloud_payments/namespaces/kassa_spec.rb
|
@@ -217,6 +219,7 @@ test_files:
|
|
217
219
|
- spec/cloud_payments/models/secure3d_spec.rb
|
218
220
|
- spec/cloud_payments/models/subscription_spec.rb
|
219
221
|
- spec/cloud_payments/models/transaction_spec.rb
|
222
|
+
- spec/cloud_payments/namespaces/apple_pay_spec.rb
|
220
223
|
- spec/cloud_payments/namespaces/base_spec.rb
|
221
224
|
- spec/cloud_payments/namespaces/cards_spec.rb
|
222
225
|
- spec/cloud_payments/namespaces/kassa_spec.rb
|