bunny_app 1.23.0 → 1.25.0

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
  SHA256:
3
- metadata.gz: de9822b5c8f2a3e7d121b0475e74e8f10bd974a2463257d2843b343fe72f188c
4
- data.tar.gz: 836e2e8c9ceae9b0fa206b91e2b3be132afc1cae615cc6cc0bb640a3cc8d6c7b
3
+ metadata.gz: '019de290c7ea498f815013ec4361ed8d6f6b4282df2a569efbe2115d38767e1e'
4
+ data.tar.gz: 53307b39bff195f94f016c5df7a7450be01dc81ce35d49e68a44fd9ad623f0b6
5
5
  SHA512:
6
- metadata.gz: e2900d6f1e399aab13c069032926c7dac253b0ae8577e5aa16bb5ed06af586d7e8b108a721bfce2f1c9bf04d905a8209707847ace93fdd3b040d11b8246552c9
7
- data.tar.gz: 13a21e70ae4845830c3f0179cb5e502a9edca630a95c86a2396c236efef4bdf76671a34f594a7940226b344dad12e5ba6e5f797e1de59cae8444ea9842696b54
6
+ metadata.gz: 882dd75a55c66339e07d1cd5ad7cd35812ccd691be9930358e26700c67d441b096353bfb7b2baa274590086449da6efcc274d540a4d60a389204c6e2574c8d33
7
+ data.tar.gz: 4c6021936e7628efb492179b0c4da2b24ae1b3606280b8627ddfc4ee496d4ae0189b291e05f56b799adc086996e915bbf45f2f271f2c2272479fa25c15912d7d
data/README.md CHANGED
@@ -62,7 +62,7 @@ Create a config file at `config/initializers/bunny_app.rb`
62
62
 
63
63
  ```ruby
64
64
  response = BunnyApp::Subscription.create(
65
- product_plan_code: 'starter',
65
+ price_list_code: 'starter',
66
66
  options: {
67
67
  account_name: "Superdesk",
68
68
  first_name: "Meg",
@@ -58,7 +58,11 @@ module BunnyApp
58
58
 
59
59
  case res.code.to_s
60
60
  when /2[0-9][0-9]/ # HTTP 2xx
61
- JSON.parse(res.body)
61
+ response_body = JSON.parse(res.body)
62
+ raise ResponseError, response_body['errors'] if response_body['errors']
63
+
64
+ response_body
65
+
62
66
  when /401/ # Access Token Expired
63
67
  raise AuthorizationError, 'Invalid access token' unless BunnyApp.retryable
64
68
  raise AuthorizationError, 'Invalid api credentials' if retries >= 1
@@ -39,10 +39,10 @@ module BunnyApp
39
39
  GRAPHQL
40
40
 
41
41
  # rubocop:disable Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
42
- def self.create(product_plan_code:, options: {})
42
+ def self.create(price_list_code:, options: {})
43
43
  variables = {
44
44
  attributes: {
45
- productPlanCode: product_plan_code,
45
+ priceListCode: price_list_code,
46
46
  trial: options[:trial] || false
47
47
  }
48
48
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BunnyApp
4
- VERSION = '1.23.0'
4
+ VERSION = '1.25.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.0
4
+ version: 1.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bunny
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-04 00:00:00.000000000 Z
12
+ date: 2023-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty