module PayPoint::Blue
Top level module with helper methods.
Constants
- VERSION
Public Class Methods
api_client(**options)
click to toggle source
hosted_client(**options)
click to toggle source
parse_payload(json)
click to toggle source
Parse a raw JSON PayPoint
callback payload similarly to the Faraday response middlewares set up in {PayPoint::Blue::Base}.
@return [Hashie::Mash] the parsed, snake_cased response
# File lib/paypoint/blue.rb, line 31 def self.parse_payload(json) payload = json.respond_to?(:read) ? json.read : json.to_s if payload.encoding == Encoding::ASCII_8BIT payload.force_encoding "iso-8859-1" end payload = JSON.parse(payload) payload = Utils.snakecase_and_symbolize_keys(payload) Hashie::Mash.new(payload) end