Skip to main content

Easypay service

Easypay service is an internal RESTful api, it communicates with Easypay via an IPSec Tunnel.

Technologies

  • Ruby on Rails
  • PostgreSQL
  • OpenSwan for IPSec tunnel

Setup to run locally

docker-compose run web rake db:create

Deployments

To deploy to staging environment

bundle exec cap staging deploy

To deploy to production

./bin/deploy.sh production

API calls

The api exposes 4 calls, each call requires a token.

         send_advice_request_v1_request GET  /v1/requests/:id/send_advice_request(.:format)         v1/requests#send_advice_request

get_easypay_payment_information_v1_requests POST /v1/requests/get_easypay_payment_information(.:format) v1/requests#get_easypay_payment_information v1_requests POST /v1/requests(.:format) v1/requests#create v1_request GET /v1/requests/:id(.:format) v1/requests#show

Get Information using Easypay reference

  • Terminal is either RConnect | reos
  • Success Response:

    • Code: 200
      Content:
      ```json
      {
      "request": {
      "response_code": "000000",
      "response_message": "Successful",
      "vagas_response_code": "000000",
      "vagas_response_message": "Successful",
      "receiver": "City of Cape Town",
      "payable": "true",
      "success": true
      }
      }
      ```
  • Error Response:

    • Code: 403 FORBIDDEN
      Content: { custom_error_message : "Operation not permitted - requires a valid api token" }

Submit Easypay payment

  • URL

    https://easypay-api.reos.co.za/v1/requests

  • Method:

    POST

  • Header Params

    Required:

    Authorization Token=[Random base64 string to be provided]
    content_type=[application/vnd.api+json]

    BODY

    {
    "data": {
    "reference": "Outgoing Payment Refernce",
    "original_request_id": "nil", // if new
    "customer_reference": "customer reference just ASCII",
    "easypay_reference": "easypay reference",
    "terminal": "reos",
    "tender": {
    "amount": "Amount in cents",
    "type": "Cash",
    "from_account": "CURRENT"
    }
    }
    }
  • Success Response:

    • Code: 200
      Content:
      ```json
      {
      "request": {
      "transaction_id",
      "workflow_state": "request_accepted",
      "correct_amount",
      "expiry_date",
      "response_code",
      "response_message",
      "response_detail",
      "requests_id",
      "data"
      }
      }
      ```
  • Error Response:

    Content:

        {
    "request": {
    "transaction_id",
    "workflow_state": "rejected",
    "correct_amount",
    "expiry_date",
    "response_code",
    "response_message",
    "response_detail",
    "requests_id",
    "data"
    }
    }
    ```