Payment URL

Q Endpoints


getPaymentURL


This service registers the transaction and returns a URL with encrypted parameters to continue the sale


Request Method

POST

Inputs

M = Mandatory

O = Optional

NameTypeDescription
merchant_id (M)stringYour merchant ID provided to you by Q
login_id (M)stringYour login id provided to you by Q
Password (M)stringYour password provided to you by Q
api_keystringKey defined by Q for this service
merchant_transaction_id (M)string (20)Your unique id for this transaction determined by you. Max length of 20 charactersEg. Order number, invoice number, etcThis value will be returned to you in the response
transaction_amount (M)intThe total order amount in NZ cents.
The value is in Cents. So for $789.00 the value
should be 78900
include_product_codes (O)List product_codeOptional attribute. This list of Q product codes will cause our payment gateway to ONLYdisplay the products in this list. This gives you the ability to nominate a LTF product or list of products applicable to the items being purchased.N.B. If the product code supplied is invalid then itwill not be displayed. If this list causes no products to be available, you will receive an error
exclude_product_codes (O)List product_codeOptional attribute. This is a list of Q product codes to be excluded from your normallist of financial products. This gives you the ability to exclude financial products that you do not deem appropriate for the transaction/customer.
product_code (M)stringThe financial product code as defined by Q
url_response (M)stringYour URL that Flexi Cards payment gateway should redirect the customer too after completion of purchase transaction. Applicable for approved, declined or cancelled transactions. When Flexi Cards Payment Gateway redirects the transaction back to the URL, the following query parameters will be added:
direct_to_url_response (M)booleanIf false the customer will be directed to a response page upon completion of thetransaction. This page will display the result of the transaction i.e. Approved / Declined. The customer will then automatically be redirected back to you url_response in approximately 5seconds.If true the customer will be redirected to the value set in the url_response parameter on completion of the transaction. It will then be your responsibility to notify the customer on the success or failure of the payment.
lineItems (O)List LineItemOptional array of line items that the customer wishes to purchase.
transmission_date_time (M)stringTimestamp when the request is being generated. The format is:yyyyMMddHHmmss where :yyyyMMddHHmmss where :
yyyy = year represented with four digit
MM = two digit month in the year number (1-12)
dd = two digit day in the month number (1-31)
HH = two digit hour in a day number (00 – 23)
mm = two digit minutes in an hour number (00 – 59)
ss = two digit seconds in a minute number (00 – 59)

Outputs

NameTypeDescription
payment_urlstringThe unique URL which you will use to redirect the customer to proceed with the payment.
process_nostringUnique reference for this transaction. This number is used as the input value for the getPayment Status to find out the progress of the transaction
merchant_transaction_idstringMerchant's unique ID for this transaction
resultCodestring00 is successful. Any other value is an error state and the response should be treated as such
resultDescstringDescription of the code
transmission_date_timestringTimestamp when the response has been generated by Flexi Payment Gateway. The format is:yyyyMMddHHmmss where:
yyyy = year represented with four digit
MM = two digit month in the year number (1-12)
dd = two digit day in the month number (1-31)
HH = two digit hour in a day number (00 – 23)
mm = two digit minutes in an hour number (00 – 59)
ss = two digit seconds in a minute number (00 – 59)

Examples

Rest Example Request

{
    "merchant_id": "12321",
    "login_id":"203399",
    "password":"Password01",
    "api_key":"2bef9740cd0be5995e58f9eef3249cabbd65d4bc",   
    "merchant_transaction_id": "123",
    "transaction_amount": 2000,
    "include_product_codes": {
    "product_code": [
        "6_MTHS","12_MTHS"
      ]
    },
    "url_response": "https://www.google.co.nz",
   "direct_to_url_response": "True",
    "lineItems": {
      "lineItem": {
        "merchant_product_code": "S7",
        "description": "Galaxy S7",
        "quantity": "1",
        "amount": "2000"
      }
    },
    "transmission_date_time": "20160909090990" 
}

Rest Example Response - Success

{
   "payment_url": "https://fpforawls02.int.rfs.co.nz:8812/gateway_simulator/payment/url?tid=josBrqe0cRAx2-QReFliFg&requestvalue=BT4ujqJ1md0MEN0Owl7fDrtYCIxJQlJKkkzfRRMCRSPVbOU2TvKiqDgtLQ73cJT4PogBAKdOjF-nJz8DFS4utj9vaNxhHzgXbbtB6Lu76882igkdInTFG7QQEYId47rP",
   "process_no": "2000",
   "merchant_transaction_id": "123",
   "result":    {
      "resultCode": "00",
      "resultDesc": "ACCEPT_SUCCESSFUL"
   }
}

Rest Example Response - Unsuccessful

{
   "payment_url": null,
   "process_no": null,
   "merchant_transaction_id": null,
   "result":    {
      "resultCode": "203",
      "resultDesc": "SYSTEM_ERROR"
   },
"transmissionDateTime": null
}

Response Codes

CodeValueDescription
00ACCEPT_UNSUCCESSFULWeb service was successful
202NOT_VALIDCombination of attributes is invalid. Eg, no product codes are available due to transaction value thresholds
203SYSTEM_ERRORUnrecoverable error. If this issue persists please contact support
204INVALID_USER_DETAILEither the username or password was incorrect
209ACCESS_NOT_ALLOWEDEither the API Key is invalid or the service has been disabled
257INVALID_PRODUCT_CODESThere are no applicable product codes for the request
Possible Reasons:
  • All include_product_codes values are not in the list of applicable products for the transaction
  • exclude_product_codes values excluded all applicable products for the transaction