Product Docs Help

Get API Credentials

This is the example for getAPICredentials. The documentation for can be found here

{ "credentials": { "id": "12345", "hash": "57d2dfa80914e9668d91862836e893249fba62bfaa4ca603c84ffdc903a0e66c8b1aa44060fd586a47b98b1877a071e00fb817d872508c5b5a2ac8e5bbad50fa", "version": "2.5.0", "client": "Pluginname:Qvickly:1.0", "language": "sv", "time": 1714944786.554058 }, "data": { "hash": "123456abc123456abc123456abc12345", "eid": "23456" }, "function": "getAPICredentials" }
<?php declare(strict_types=1); require '../../../vendor/autoload.php'; use Dotenv\Dotenv; $dotenv = Dotenv::createImmutable(__DIR__ . '/../../..'); $dotenv->load(); use Qvickly\Api\Payment\PaymentAPI; use Qvickly\Api\Payment\DataObjects\Data; $paymentAPI = new PaymentAPI($_ENV['EID'], $_ENV['SECRET']); $data = new Data( [ "hash" => "123456abc123456abc123456abc12345", "eid" => "23456", ] ); $credentials = $paymentAPI->getAPICredentials($data); print_r($credentials);

Full example can be found here

This code requires our composer package qvickly/api

composer require qvickly/api
<?php include('../PaymentAPI.php'); $test = true; $debug = false; /* Credentials for Auth */ $id = "12345"; $key = "123451234512"; define("QVICKLY_SERVER", "2.5.0"); // API version define("QVICKLY_CLIENT", "Pluginname:Qvickly:1.0"); define("QVICKLY_LANGUAGE", "sv"); $api = new PaymentAPI($id, $key, $test, $debug); $values = array(); $values["hash"] = "123456abc123456abc123456abc12345"; $values["eid"] = "23456"; echo json_encode($api->getAPICredentials($values), JSON_PRETTY_PRINT);

Full example can be found here

import { QvicklyPaymentAPI } from "../../PaymentAPI.js"; const paymentAPI = new QvicklyPaymentAPI(process.env.EID, process.env.SECRET); const credentials = await paymentAPI.call("getAPICredentials", { hash: "123456abc123456abc123456abc12345", eid: "23456", }); console.log(credentials);

Full example can be found here

import {QvicklyPaymentAPI, env} from "../../PaymentAPI.ts"; const paymentAPI = new QvicklyPaymentAPI(env["EID"], env["SECRET"]); const credentials = await paymentAPI.call("getAPICredentials", { hash: "123456abc123456abc123456abc12345", eid: "23456", }); console.log(credentials);

Full example can be found here

import QvicklyPaymentAPI from "../../PaymentAPI"; const paymentAPI = new QvicklyPaymentAPI(Bun.env.EID, Bun.env.SECRET); const credentials = await paymentAPI.call("getAPICredentials", { hash: "123456abc123456abc123456abc12345", eid: "23456", }); console.log(credentials);

Full example can be found here

from PaymentAPI import PaymentAPI # Create a PaymentAPI object api = PaymentAPI(eid, secret) credentials = api.call(function="getAPICredentials", data={"hash":"123456abc123456abc123456abc12345", "eid": "23456"}) print(json.dumps(credentials, indent=4))

Full example can be found here

#!/usr/bin/perl use strict; use warnings; use JSON::PP; use Data::Dumper; use lib '../..'; require "PaymentAPI.pl"; require "LoadEnv.pl"; LoadEnv('../../.env'); my $test = 1; my $debug = 0; # Credentials for Auth my $id = $ENV{"EID"}; my $key = $ENV{"SECRET"}; my $api = PaymentAPI->new($id, $key, $test, $debug); my $values = { "hash" => "123456abc123456abc123456abc12345", "eid" => "23456", }; print(Dumper($api->call("getAPICredentials", $values))); 1;

Full example can be found here

Response from server

For information about the response from the server, please contact Qvickly Support.

Last modified: 13 September 2024