Class: Pesamoni::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/pesamoni_ruby/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



7
8
9
# File 'lib/pesamoni_ruby/api/default_api.rb', line 7

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



5
6
7
# File 'lib/pesamoni_ruby/api/default_api.rb', line 5

def api_client
  @api_client
end

Instance Method Details

#transactions_post(method, opts = {}) ⇒ InlineResponse200

Below are parameters and their respective expected responses. In order to try out the service, simply click Try it out.

Parameters:

  • method

    Enter a request method. To check for request methods <a href=''>click here</a>

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :amount (String)

    Enter the amount you would like to request for. <p style="color:red">This method applies for request methods <b>acreceive, acreceivekeac, acsend, acsendkeac, acsendbank, pesab2c, sendairtime, cardaccept</b></p>

  • :mobile (String)

    Enter the mobile number you would like to execute the above method in format 256.… or 254…<p style="color:red">This method applies for request methods <b>acreceive, acreceivekeac, acsend, acsendkeac, senderid, sendsms, sendairtime</b></p>

  • :holdername (String)

    Enter name of payer for Visa/MasterCard transactions<p style="color:red">This method applies for request method <b>cardaccept</b></p>

  • :cardnumber (String)

    Enter the Visa/MasterCard cardnumber<p style="color:red">This method applies for request method <b>cardaccept</b></p>

  • :cvv (String)

    Enter the Visa/MasterCard cvv<p style="color:red">This method applies for request method <b>cardaccept</b></p>

  • :exp (String)

    Enter the Visa/MasterCard expiry date in the format MM/YYYY e.g 07/2030<p style="color:red">This method applies for request method <b>cardaccept</b></p>

  • :currency (String)

    Enter the currency you intend to make the transaction for Visa/MasterCard based transactions<p style="color:red">This method applies for request method <b>cardaccept</b></p>

  • :account (String)

    Enter the Pesamoni account you would like to use for this transaction<p style="color:red">This method applies for request method <b>paybills</b></p>

  • :reference (String)

    Enter your user generated transaction reference<p style="color:red">This method applies for request methods <b>acreceive, acreceivekeac, acsend, acsendkeac, sendsms, transactionstatus, sendairtime, pesab2c, sendsms, cardaccept</b></p>

  • :genericmsg (String)

    Enter your user generated generic message for the requested transaction<p style="color:red">This method applies for request methods <b>acreceive, acreceivekeac, acsend, acsendkeac, sendsms, sendairtime, pesab2c, sendsms, cardaccept</b></p>

  • :token (String)

    Enter your user generated token for the above mentioned method<p style="color:red">This method applies for request methods <b>acreceive, acreceivekeac, acsend, acsendkeac, sendsms, sendairtime, pesab2c, sendsms, cardaccept</b></p>

  • :bouquet (String)

    Enter the bouquet or package you would like to pay for<p style="color:red">This method applies for request methods <b>paybills</b></p>

  • :payoption (String)

    Enter your prefered payment option<p style="color:red">This method applies for request methods <b>paybills</b></p>

  • :meternumber (String)

    Enter the meter number for the intended payment<p style="color:red">This method applies for request methods <b>paybills</b></p>

Returns:



28
29
30
31
# File 'lib/pesamoni_ruby/api/default_api.rb', line 28

def transactions_post(method, opts = {})
  data, _status_code, _headers = transactions_post_with_http_info(method, opts)
  data
end

#transactions_post_with_http_info(method, opts = {}) ⇒ Array<(InlineResponse200, Fixnum, Hash)>

Below are parameters and their respective expected responses. In order to try out the service, simply click Try it out.

Parameters:

  • method

    Enter a request method. To check for request methods &lt;a href&#x3D;&#39;&#39;&gt;click here&lt;/a&gt;

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :amount (String)

    Enter the amount you would like to request for. &lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;acreceive, acreceivekeac, acsend, acsendkeac, acsendbank, pesab2c, sendairtime, cardaccept&lt;/b&gt;&lt;/p&gt;

  • :mobile (String)

    Enter the mobile number you would like to execute the above method in format 256.… or 254…&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;acreceive, acreceivekeac, acsend, acsendkeac, senderid, sendsms, sendairtime&lt;/b&gt;&lt;/p&gt;

  • :holdername (String)

    Enter name of payer for Visa/MasterCard transactions&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;cardaccept&lt;/b&gt;&lt;/p&gt;

  • :cardnumber (String)

    Enter the Visa/MasterCard cardnumber&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;cardaccept&lt;/b&gt;&lt;/p&gt;

  • :cvv (String)

    Enter the Visa/MasterCard cvv&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;cardaccept&lt;/b&gt;&lt;/p&gt;

  • :exp (String)

    Enter the Visa/MasterCard expiry date in the format MM/YYYY e.g 07/2030&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;cardaccept&lt;/b&gt;&lt;/p&gt;

  • :currency (String)

    Enter the currency you intend to make the transaction for Visa/MasterCard based transactions&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;cardaccept&lt;/b&gt;&lt;/p&gt;

  • :account (String)

    Enter the Pesamoni account you would like to use for this transaction&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request method &lt;b&gt;paybills&lt;/b&gt;&lt;/p&gt;

  • :reference (String)

    Enter your user generated transaction reference&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;acreceive, acreceivekeac, acsend, acsendkeac, sendsms, transactionstatus, sendairtime, pesab2c, sendsms, cardaccept&lt;/b&gt;&lt;/p&gt;

  • :genericmsg (String)

    Enter your user generated generic message for the requested transaction&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;acreceive, acreceivekeac, acsend, acsendkeac, sendsms, sendairtime, pesab2c, sendsms, cardaccept&lt;/b&gt;&lt;/p&gt;

  • :token (String)

    Enter your user generated token for the above mentioned method&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;acreceive, acreceivekeac, acsend, acsendkeac, sendsms, sendairtime, pesab2c, sendsms, cardaccept&lt;/b&gt;&lt;/p&gt;

  • :bouquet (String)

    Enter the bouquet or package you would like to pay for&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;paybills&lt;/b&gt;&lt;/p&gt;

  • :payoption (String)

    Enter your prefered payment option&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;paybills&lt;/b&gt;&lt;/p&gt;

  • :meternumber (String)

    Enter the meter number for the intended payment&lt;p style&#x3D;&quot;color:red&quot;&gt;This method applies for request methods &lt;b&gt;paybills&lt;/b&gt;&lt;/p&gt;

Returns:

  • (Array<(InlineResponse200, Fixnum, Hash)>)

    InlineResponse200 data, response status code and response headers



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/pesamoni_ruby/api/default_api.rb', line 51

def transactions_post_with_http_info(method, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.transactions_post ...'
  end
  # verify the required parameter 'method' is set
  if @api_client.config.client_side_validation && method.nil?
    fail ArgumentError, "Missing the required parameter 'method' when calling DefaultApi.transactions_post"
  end
  # resource path
  local_var_path = '/transactions'

  # query parameters
  query_params = {}
  query_params[:'method'] = method
  query_params[:'amount'] = opts[:'amount'] if !opts[:'amount'].nil?
  query_params[:'mobile'] = opts[:'mobile'] if !opts[:'mobile'].nil?
  query_params[:'holdername'] = opts[:'holdername'] if !opts[:'holdername'].nil?
  query_params[:'cardnumber'] = opts[:'cardnumber'] if !opts[:'cardnumber'].nil?
  query_params[:'cvv'] = opts[:'cvv'] if !opts[:'cvv'].nil?
  query_params[:'exp'] = opts[:'exp'] if !opts[:'exp'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?
  query_params[:'account'] = opts[:'account'] if !opts[:'account'].nil?
  query_params[:'reference'] = opts[:'reference'] if !opts[:'reference'].nil?
  query_params[:'genericmsg'] = opts[:'genericmsg'] if !opts[:'genericmsg'].nil?
  query_params[:'token'] = opts[:'token'] if !opts[:'token'].nil?
  query_params[:'bouquet'] = opts[:'bouquet'] if !opts[:'bouquet'].nil?
  query_params[:'payoption'] = opts[:'payoption'] if !opts[:'payoption'].nil?
  query_params[:'meternumber'] = opts[:'meternumber'] if !opts[:'meternumber'].nil?

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['apipassword', 'apiusername']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse200')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#transactions_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end