module Slimpay

Slimpay module defines Simpay's HAPI constants and require dependencies. TODO: If-None-Match support. (next answer ?= 304) TODO: wiki/doc full worflow: 1. App to change URls, 2. Order to sign mandate, 3. DirectDebit to pay with mandate.

Constants

PRODUCTION_ENDPOINT
SANDBOX_CLIENT_ID
SANDBOX_CREDITOR
SANDBOX_ENDPOINT
SANDBOX_SECRET_ID
VERSION

Attributes

configuration[RW]

Public Class Methods

answer(http_response) click to toggle source

Used to display HTTP requests responses nicely in case of error.

Arguments:
http_response: (HTTParty::Response)
# File lib/slimpay.rb, line 51
def self.answer(http_response)
  return Slimpay::Error.empty if http_response.nil?
  if http_response.code >= 400
    Slimpay::Error.new(http_response)
  else
    http_response.body
  end
end
configure() { |configuration| ... } click to toggle source

Sets the initial configuration for client_id, client_secret and creditor_reference

Usage:
Slimpay.configure do |config|
  config.client_id = "your_client_id"
  config.client_secret = "your_client_secret"
  config.creditor_reference = "your_creditor_reference"
  config.sandbox = true
  config.notify_url = 'you_notifications_url'
  config.return_url = 'your_return_url'
end
# File lib/slimpay.rb, line 42
def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end