omise / omise-ruby

Omise Ruby Library
https://docs.opn.ooo
MIT License
40 stars 20 forks source link

uninitialized constant Omise::Scheduler::WEEKDAY_OF_MONTH #27

Closed danfowler closed 3 years ago

danfowler commented 5 years ago

Running this sample code from https://www.omise.co/charge-schedules-api

require "omise"

Omise.secret_api_key = ENV['OMISE_SECRET_KEY']

scheduler = Omise::Charge.schedule({
  customer:    cust_test.id,
  card:        card_test.id,
  amount:      100000,
  description: "Membership fee"
})

schedule = scheduler.every(1).month(on: "2nd_monday")
  .start_date("2022-11-01")
  .end_date("2022-12-31")
  .start

Raises this error:

Traceback (most recent call last):

2: from samples//2014-07-27/charge_schedules/create/create_monthly_by_week.rb:12:in `<main>'
1: from /Users/dan/.rvm/gems/ruby-2.5.1/gems/omise-0.7.1/lib/omise/scheduler.rb:56:in `months'
/Users/dan/.rvm/gems/ruby-2.5.1/gems/omise-0.7.1/lib/omise/scheduler.rb:141:in `month_with_weekday': uninitialized constant Omise::Scheduler::WEEKDAY_OF_MONTH (NameError)
robinclart commented 5 years ago

Will fix soon