Sha256: 6705a7c55cef02982a106f5f18c03c3463cfd9d14b4000464164ccd751432026

Contents?: true

Size: 458 Bytes

Versions: 9

Compression:

Stored size: 458 Bytes

Contents

require 'faraday'

module Faraday
  class Response::StripCardNumbers < Response::Middleware
    
    def parse(body)
      if body
        if body["egc"]
          body["egc"].delete("egc_number")
          body["egc"].delete("access_code")
        end
        if body["order"] and body["order"]["egc"]
          body["order"]["egc"].delete("egc_number")
          body["order"]["egc"].delete("access_code")
        end
      end
      body
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
cashstar-ruby-0.2.4 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.2.3 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.2.2 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.2.1 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.2.0 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.1.8 lib/faraday/response/strip_card_numbers.rb
cashstar-ruby-0.1.7 lib/faraday/response/strip_card_numbers.rb
cashstar-0.1.5 lib/faraday/response/strip_card_numbers.rb
cashstar-0.1.4 lib/faraday/response/strip_card_numbers.rb