Validate Login

Du er her:
Anslået læsetid: 1 min

When you utilize Yourpays services, be it eigher POS or online payments, your details needs to be validated and verified by Yourpay. We use our API function ‘validatelogin’ for this purpose.

This function requires three pieces of information:

– a Yourpay username

– a password

– the value ‘1’ indicating if this is a POS terminal or ‘0’ if it’s not.

I’ve included a code example here.

TIP You can open the file with notepad, if you do not have an editor for viewing source code.

If you run the code by uploading it to your server and navigating to the file, you are presented with a input form.

validate_login_form.PNG

The input fields are tied to a request parameter that we send to the API:

Parameter names in this table are written in italic.

Name Description
Username (username) Your username for the merchant. Genereally the email. You have this in the email from when the merchant was created.
Password (password) Your password generated through Yourpay. You have this in the email from when you first created the merchant. If not contact Yourpay.
TerminalLogin (terminal) This parameter’s value can be eigher ‘1’ if its a terminal or ‘0’ if it’s not.

When you submit this form you should get a response like this:

Name Description
click This is an id we use internally.
uid The merchants user id
sessionkey Your sessionkey, this id is not persistent, and expires after some time.
pincode This will always be empty
terminal If you set terminal to ‘0’ this will be an empty array. If its set to ‘1’ it will contain a few variables described in the table below.
token Your merchant token. You need this for various other API calls.

The following table lists the variables returned in the terminal array of the main response, if terminal is set to ‘1‘.

Name Description
active If the terminal is active or not. 1 = yes, 0 = no
terminal_identifier Production identifier for the terminal.
terminal_key Key used by the terminal to authenticate with our system.
test_terminal_identifier Test identifier for the terminal.
test_terminal_key Test key used by the terminal to authenticate with our system.
merchantid Your merchantid used for test payments.
merchantid_prod Your merchantid for production. Needed to process real payments.
token Your merchant token