chargebee / chargebee-ruby

Ruby library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=ruby
MIT License
32 stars 60 forks source link

Result cannot return `non_subscription` #78

Closed Adiis closed 3 months ago

Adiis commented 3 months ago

According to the documentation, Result should be able to return non_subscription:

require 'chargebee'
ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")
result = ChargeBee::NonSubscription.process_receipt("cb-pjp7hcmrcbfmtjhle3smlwicu4",{
  :receipt => "Apple Based64 Encoded Receipt",
  :product => {
    :id => "app_store_charge_id",
    :price => "3399",
    :price_in_decimal => "33.99",
    :currency_code => "USD",
    :type => "CONSUMABLE"
    },
  :customer => {
    :id => "customer-123"
    }
  })
non_subscription = result.non_subscription

However, in release 2.39.0 the non_subscription() method has been removed, which results in error:

NoMethodError: undefined method `non_subscription' for #<ChargeBee::Result:0x0000000109f9bff0...
cb-alish commented 3 months ago

hi @Adiis this has been fixed in latest version v2.41.0. Please give it a try and get back if that doesn't work for you.

Adiis commented 3 months ago

Now it works as expected! Thank you, @cb-alish!