class NedbankApi::PaymentsApi

Constants

API_PATHS

Public Class Methods

create_intent(request_body: {}, headers: {}) click to toggle source
# File lib/nedbank_api/payments_api.rb, line 10
def create_intent(request_body: {}, headers: {})
  http = Http.new(url: endpoint(API_PATHS[:payments]))

  response = http.post(
    headers: auth_headers,
    body: request_body.to_json
  )

  return Models::Payment.new(json_to_object(response.body))
end
get_payment_submission(payment_submission_id:, headers: {}) click to toggle source
# File lib/nedbank_api/payments_api.rb, line 32
def get_payment_submission(payment_submission_id:, headers: {})
  http = Http.new(url: endpoint(API_PATHS[:payment_submissions], suffix: payment_submission_id))

  response = http.get(
    headers: auth_headers
  )

  return Models::PaymentSubmission.new(json_to_object(response.body))
end
submit_payment(request_body: {}, headers: {}) click to toggle source
# File lib/nedbank_api/payments_api.rb, line 21
def submit_payment(request_body: {}, headers: {})
  http = Http.new(url: endpoint(API_PATHS[:payment_submissions]))

  response = http.post(
    headers: auth_headers,
    body: request_body.to_json
  )

  return Models::PaymentSubmission.new(json_to_object(response.body))
end