Sha256: cd6140a74669eefb3a58d6b9683428283ee38005b2213c740adb50106d652a33

Contents?: true

Size: 662 Bytes

Versions: 1

Compression:

Stored size: 662 Bytes

Contents

module FakeBraintree
  class Subscription
    include Helpers

    def initialize(request)
      @subscription_hash = Hash.from_xml(request.body).delete("subscription")
    end

    def response_hash
      response_hash = {}
      response_hash["id"]                = md5("#{@subscription_hash["payment_method_token"]}#{Time.now.to_f}")[0,6]
      response_hash["transactions"]      = []
      response_hash["add_ons"]           = []
      response_hash["discounts"]         = []
      response_hash["next_billing_date"] = 1.month.from_now
      response_hash["status"]            = Braintree::Subscription::Status::Active

      response_hash
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fake_braintree-0.0.5 lib/fake_braintree/subscription.rb