Class: Response::StripCardNumbers

Inherits:
Middleware
  • Object
show all
Defined in:
lib/faraday/response/strip_card_numbers.rb

Instance Method Summary collapse

Instance Method Details

#parse(body) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/faraday/response/strip_card_numbers.rb', line 6

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