chargebee 2.26.1 → 2.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -2
- data/Gemfile.lock +1 -1
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/chargebee.gemspec +4 -4
- data/lib/chargebee/models/customer.rb +2 -2
- data/lib/chargebee/models/hosted_page.rb +4 -0
- data/lib/chargebee/models/item_price.rb +1 -1
- data/lib/chargebee/models/payment_source.rb +13 -1
- data/lib/chargebee/models/payment_voucher.rb +32 -0
- data/lib/chargebee/result.rb +7 -1
- data/lib/chargebee.rb +1 -1
- metadata +4 -4
- data/README.rdoc +0 -41
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a71e6c217fdd4316a5090721f0effe7f5d5322b8
|
4
|
+
data.tar.gz: 5a29c6d4e6824262bacf5632d910a650ee21e6e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf709864327f3e7c0688ea36132a1b2a42add682d2f1ba4dfca6b4ad254403a540bb0886a5c4163d86993b6dbc99f655bc6e9611a3d8f1b326f8564b2493f49
|
7
|
+
data.tar.gz: 18383b2cb668d33f4fad8d4aee114b34a41fbfe6ec9cd2a5bfd2b95def7525f8e193019668d52a006f002bf48517a3791c1be0fd60074ded6a586c0eab0ceed7
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,27 @@
|
|
1
|
-
### v2.
|
1
|
+
### v2.27.0 (2023-05-31)
|
2
2
|
* * *
|
3
3
|
|
4
|
-
|
4
|
+
#### New endpoints:
|
5
|
+
* PaymentSource#CreateVoucherPaymentSource has been added to the PaymentSource resource.
|
6
|
+
* EventsRequest#HostedPage has been added to the PaymentSource resource.
|
7
|
+
|
8
|
+
#### New Resource:
|
9
|
+
* PaymentVoucher has been added.
|
10
|
+
|
11
|
+
#### New attributes:
|
12
|
+
* boleto and billing_address has been added to the PaymentSource resource.
|
13
|
+
* product_id has been added to the ItemPrice resource.
|
14
|
+
|
15
|
+
#### New Enum Class:
|
16
|
+
* EventNameEnum has been added.
|
17
|
+
* PaymentVoucherTypeEnum has been added.
|
18
|
+
* VoucherTypeEnum has been added.
|
19
|
+
|
20
|
+
#### New Enum values:
|
21
|
+
* product and variant has been added to EntityType enum.
|
22
|
+
* product_created, product_updated, product_deleted, variant_created, variant_updated and variant_deleted enums have been added in EventType enum.
|
23
|
+
* voucher_created, voucher_expired and voucher_create_failed have been added in EventType enum.
|
24
|
+
* boleto has been added in PaymentMethod and OfflinePaymentMethod and PaymentMethodTypeEnum#PaymentIntent.
|
5
25
|
|
6
26
|
|
7
27
|
### v2.26.0 (2023-05-16)
|
data/Gemfile.lock
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![gem](https://img.shields.io/gem/v/chargebee.svg?maxAge=2592000)](https://rubygems.org/gems/chargebee)
|
4
4
|
[![gem](https://img.shields.io/gem/dtv/chargebee.svg?maxAge=2592000)](https://rubygems.org/gems/chargebee)
|
5
5
|
|
6
|
-
This is the Ruby Library for integrating with Chargebee. Sign up for a Chargebee account
|
6
|
+
This is the Ruby Library for integrating with Chargebee. Sign up for a Chargebee account [here](https://www.chargebee.com).
|
7
7
|
|
8
8
|
Chargebee now supports two API versions - [V1](https://apidocs.chargebee.com/docs/api/v1) and [V2](https://apidocs.chargebee.com/docs/api), of which V2 is the latest release and all future developments will happen in V2. This library is for <b>API version V2</b>. If you’re looking for V1, head to [chargebee-v1 branch](https://github.com/chargebee/chargebee-ruby/tree/chargebee-v1).
|
9
9
|
|
@@ -39,7 +39,7 @@ puts "created subscription is #{subscription}"
|
|
39
39
|
|
40
40
|
### Create an Idempotent Request
|
41
41
|
|
42
|
-
[Idempotency keys](https://apidocs.chargebee.com/docs/api) are passed along with request headers to allow a safe retry of POST requests.
|
42
|
+
[Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests.
|
43
43
|
|
44
44
|
```ruby
|
45
45
|
require 'chargebee'
|
data/chargebee.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
s.required_ruby_version = '>= 1.9.3'
|
6
6
|
s.name = 'chargebee'
|
7
|
-
s.version = '2.
|
8
|
-
s.date = '2023-05-
|
7
|
+
s.version = '2.27.0'
|
8
|
+
s.date = '2023-05-31'
|
9
9
|
s.summary = "Ruby client for Chargebee API."
|
10
10
|
s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
|
11
11
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.require_paths = %w[lib]
|
18
18
|
|
19
19
|
s.rdoc_options = ["--charset=UTF-8"]
|
20
|
-
s.extra_rdoc_files = %w[README.
|
20
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
21
21
|
|
22
22
|
s.add_dependency('json_pure', '~> 2.1')
|
23
23
|
s.add_dependency('rest-client', '>=1.8', '<=2.0.2')
|
@@ -32,7 +32,6 @@ Gem::Specification.new do |s|
|
|
32
32
|
Gemfile.lock
|
33
33
|
LICENSE
|
34
34
|
README.md
|
35
|
-
README.rdoc
|
36
35
|
Rakefile
|
37
36
|
chargebee.gemspec
|
38
37
|
lib/chargebee.rb
|
@@ -78,6 +77,7 @@ Gem::Specification.new do |s|
|
|
78
77
|
lib/chargebee/models/order.rb
|
79
78
|
lib/chargebee/models/payment_intent.rb
|
80
79
|
lib/chargebee/models/payment_source.rb
|
80
|
+
lib/chargebee/models/payment_voucher.rb
|
81
81
|
lib/chargebee/models/plan.rb
|
82
82
|
lib/chargebee/models/portal_session.rb
|
83
83
|
lib/chargebee/models/promotional_credit.rb
|
@@ -53,7 +53,7 @@ module ChargeBee
|
|
53
53
|
# OPERATIONS
|
54
54
|
#-----------
|
55
55
|
|
56
|
-
def self.create(params
|
56
|
+
def self.create(params, env=nil, headers={})
|
57
57
|
Request.send('post', uri_path("customers"), params, env, headers)
|
58
58
|
end
|
59
59
|
|
@@ -65,7 +65,7 @@ module ChargeBee
|
|
65
65
|
Request.send('get', uri_path("customers",id.to_s), {}, env, headers)
|
66
66
|
end
|
67
67
|
|
68
|
-
def self.update(id, params
|
68
|
+
def self.update(id, params, env=nil, headers={})
|
69
69
|
Request.send('post', uri_path("customers",id.to_s), params, env, headers)
|
70
70
|
end
|
71
71
|
|
@@ -98,5 +98,9 @@ module ChargeBee
|
|
98
98
|
Request.send('post', uri_path("hosted_pages","pre_cancel"), params, env, headers)
|
99
99
|
end
|
100
100
|
|
101
|
+
def self.events(params, env=nil, headers={})
|
102
|
+
Request.send('post', uri_path("hosted_pages","events"), params, env, headers)
|
103
|
+
end
|
104
|
+
|
101
105
|
end # ~HostedPage
|
102
106
|
end # ~ChargeBee
|
@@ -13,7 +13,7 @@ module ChargeBee
|
|
13
13
|
attr_accessor :sku, :accounting_code, :accounting_category1, :accounting_category2, :accounting_category3, :accounting_category4
|
14
14
|
end
|
15
15
|
|
16
|
-
attr_accessor :id, :name, :item_family_id, :item_id, :description, :status, :external_name,
|
16
|
+
attr_accessor :id, :name, :item_family_id, :product_id, :item_id, :description, :status, :external_name,
|
17
17
|
:pricing_model, :price, :price_in_decimal, :period, :currency_code, :period_unit, :trial_period,
|
18
18
|
:trial_period_unit, :trial_end_action, :shipping_period, :shipping_period_unit, :billing_cycles,
|
19
19
|
:free_quantity, :free_quantity_in_decimal, :channel, :resource_version, :updated_at, :created_at,
|
@@ -9,6 +9,14 @@ module ChargeBee
|
|
9
9
|
attr_accessor :last4, :name_on_account, :first_name, :last_name, :bank_name, :mandate_id, :account_type, :echeck_type, :account_holder_type, :email
|
10
10
|
end
|
11
11
|
|
12
|
+
class CustVoucherSource < Model
|
13
|
+
attr_accessor :last4, :first_name, :last_name, :email
|
14
|
+
end
|
15
|
+
|
16
|
+
class BillingAddress < Model
|
17
|
+
attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
|
18
|
+
end
|
19
|
+
|
12
20
|
class AmazonPayment < Model
|
13
21
|
attr_accessor :email, :agreement_id
|
14
22
|
end
|
@@ -27,7 +35,7 @@ module ChargeBee
|
|
27
35
|
|
28
36
|
attr_accessor :id, :resource_version, :updated_at, :created_at, :customer_id, :type, :reference_id,
|
29
37
|
:status, :gateway, :gateway_account_id, :ip_address, :issuing_country, :card, :bank_account,
|
30
|
-
:amazon_payment, :upi, :paypal, :mandates, :deleted, :business_entity_id
|
38
|
+
:boleto, :billing_address, :amazon_payment, :upi, :paypal, :mandates, :deleted, :business_entity_id
|
31
39
|
|
32
40
|
# OPERATIONS
|
33
41
|
#-----------
|
@@ -48,6 +56,10 @@ module ChargeBee
|
|
48
56
|
Request.send('post', uri_path("payment_sources","create_using_payment_intent"), params, env, headers)
|
49
57
|
end
|
50
58
|
|
59
|
+
def self.create_voucher_payment_source(params, env=nil, headers={})
|
60
|
+
Request.send('post', uri_path("payment_sources","create_voucher_payment_source"), params, env, headers)
|
61
|
+
end
|
62
|
+
|
51
63
|
def self.create_card(params, env=nil, headers={})
|
52
64
|
Request.send('post', uri_path("payment_sources","create_card"), params, env, headers)
|
53
65
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class PaymentVoucher < Model
|
3
|
+
|
4
|
+
class LinkedInvoice < Model
|
5
|
+
attr_accessor :invoice_id, :txn_id, :applied_at
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :id, :id_at_gateway, :payment_voucher_type, :expires_at, :status, :subscription_id,
|
9
|
+
:currency_code, :amount, :gateway_account_id, :payment_source_id, :gateway, :payload, :error_code,
|
10
|
+
:error_text, :url, :date, :resource_version, :updated_at, :customer_id, :linked_invoices
|
11
|
+
|
12
|
+
# OPERATIONS
|
13
|
+
#-----------
|
14
|
+
|
15
|
+
def self.create(params, env=nil, headers={})
|
16
|
+
Request.send('post', uri_path("payment_vouchers"), params, env, headers)
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.retrieve(id, env=nil, headers={})
|
20
|
+
Request.send('get', uri_path("payment_vouchers",id.to_s), {}, env, headers)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.payment_vouchers_for_invoice(id, params={}, env=nil, headers={})
|
24
|
+
Request.send('get', uri_path("invoices",id.to_s,"payment_vouchers"), params, env, headers)
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.payment_vouchers_for_customer(id, params={}, env=nil, headers={})
|
28
|
+
Request.send('get', uri_path("customers",id.to_s,"payment_vouchers"), params, env, headers)
|
29
|
+
end
|
30
|
+
|
31
|
+
end # ~PaymentVoucher
|
32
|
+
end # ~ChargeBee
|
data/lib/chargebee/result.rb
CHANGED
@@ -66,7 +66,7 @@ module ChargeBee
|
|
66
66
|
|
67
67
|
def payment_source()
|
68
68
|
payment_source = get(:payment_source, PaymentSource,
|
69
|
-
{:card => PaymentSource::Card, :bank_account => PaymentSource::BankAccount, :amazon_payment => PaymentSource::AmazonPayment, :upi => PaymentSource::Upi, :paypal => PaymentSource::Paypal, :mandates => PaymentSource::Mandate});
|
69
|
+
{:card => PaymentSource::Card, :bank_account => PaymentSource::BankAccount, :cust_voucher_source => PaymentSource::CustVoucherSource, :billing_address => PaymentSource::BillingAddress, :amazon_payment => PaymentSource::AmazonPayment, :upi => PaymentSource::Upi, :paypal => PaymentSource::Paypal, :mandates => PaymentSource::Mandate});
|
70
70
|
return payment_source;
|
71
71
|
end
|
72
72
|
|
@@ -344,6 +344,12 @@ module ChargeBee
|
|
344
344
|
return purchase;
|
345
345
|
end
|
346
346
|
|
347
|
+
def payment_voucher()
|
348
|
+
payment_voucher = get(:payment_voucher, PaymentVoucher,
|
349
|
+
{:linked_invoices => PaymentVoucher::LinkedInvoice});
|
350
|
+
return payment_voucher;
|
351
|
+
end
|
352
|
+
|
347
353
|
|
348
354
|
def unbilled_charges()
|
349
355
|
unbilled_charges = get_list(:unbilled_charges, UnbilledCharge,
|
data/lib/chargebee.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargebee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajaraman S
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-05-
|
12
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|
@@ -100,7 +100,7 @@ email:
|
|
100
100
|
executables: []
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files:
|
103
|
-
- README.
|
103
|
+
- README.md
|
104
104
|
- LICENSE
|
105
105
|
files:
|
106
106
|
- CHANGELOG.md
|
@@ -108,7 +108,6 @@ files:
|
|
108
108
|
- Gemfile.lock
|
109
109
|
- LICENSE
|
110
110
|
- README.md
|
111
|
-
- README.rdoc
|
112
111
|
- Rakefile
|
113
112
|
- chargebee.gemspec
|
114
113
|
- lib/chargebee.rb
|
@@ -154,6 +153,7 @@ files:
|
|
154
153
|
- lib/chargebee/models/order.rb
|
155
154
|
- lib/chargebee/models/payment_intent.rb
|
156
155
|
- lib/chargebee/models/payment_source.rb
|
156
|
+
- lib/chargebee/models/payment_voucher.rb
|
157
157
|
- lib/chargebee/models/plan.rb
|
158
158
|
- lib/chargebee/models/portal_session.rb
|
159
159
|
- lib/chargebee/models/promotional_credit.rb
|
data/README.rdoc
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
= Chargebee Ruby Client Library - API V2
|
2
|
-
|
3
|
-
{<img src="https://img.shields.io/gem/v/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
|
4
|
-
{<img src="https://img.shields.io/gem/dtv/chargebee.svg?maxAge=2592000"/>}[https://rubygems.org/gems/chargebee]
|
5
|
-
|
6
|
-
This is the Ruby Library for integrating with Chargebee. Sign up for a Chargebee account {here}[https://www.chargebee.com].
|
7
|
-
|
8
|
-
Chargebee now supports two API versions - {V1}[https://apidocs.chargebee.com/docs/api/v1] and {V2}[https://apidocs.chargebee.com/docs/api], of which V2 is the latest release and all future developments will happen in V2. This library is for <b>API version V2</b>. If you’re looking for V1, head to {chargebee-v1 branch}[https://github.com/chargebee/chargebee-ruby/tree/chargebee-v1].
|
9
|
-
|
10
|
-
== Installation
|
11
|
-
|
12
|
-
Install the latest version of the gem with the following command...
|
13
|
-
|
14
|
-
$ sudo gem install chargebee -v '~>2'
|
15
|
-
|
16
|
-
|
17
|
-
== Requirements
|
18
|
-
|
19
|
-
* Ruby 1.9.3 or above.
|
20
|
-
* rest-client
|
21
|
-
|
22
|
-
== Documentation
|
23
|
-
|
24
|
-
For API reference see {here}[https://apidocs.chargebee.com/docs/api?lang=ruby]
|
25
|
-
|
26
|
-
== Usage
|
27
|
-
|
28
|
-
To create a new subscription:
|
29
|
-
|
30
|
-
ChargeBee.configure({:api_key => "your_api_key" , :site => "your_site"})
|
31
|
-
result = ChargeBee::Subscription.create({
|
32
|
-
:id => "sub_KyVqDh__dev__NTn4VZZ1",
|
33
|
-
:plan_id => "basic",
|
34
|
-
})
|
35
|
-
subscription = result.subscription
|
36
|
-
puts "created subscription is #{subscription}"
|
37
|
-
|
38
|
-
== License
|
39
|
-
|
40
|
-
See the LICENSE file.
|
41
|
-
|