Product Docs Help

Get fees

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

{ "credentials": { "id": "12345", "hash": "42d4daf5dfba7c37d72006ab5258b94248c2130473c5bcf64291f7dd3ab8bdfaedc6e8d2eaccf4f4be6a52b97408e02f8ab65076f368c4d9b56d2d1b1276c9e6", "version": "2.5.0", "client": "Pluginname:Qvickly:1.0", "language": "sv", "time": 1714941161.606741 }, "data": { "dummyData": 1714941161606698000 }, "function": "getFees" }
<?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']); $fees = $paymentAPI->getFees(); print_r($fees);

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(); echo json_encode($api->getFees($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 fees = await paymentAPI.call("getFees"); console.log(fees);

Full example can be found here

import {QvicklyPaymentAPI, env} from "../../PaymentAPI.ts"; const paymentAPI = new QvicklyPaymentAPI(env["EID"], env["SECRET"]); const fees = await paymentAPI.call("getFees"); console.log(fees);

Full example can be found here

import QvicklyPaymentAPI from "../../PaymentAPI"; const paymentAPI = new QvicklyPaymentAPI(Bun.env.EID, Bun.env.SECRET); const fees = await paymentAPI.call("getFees"); console.log(fees);

Full example can be found here

from PaymentAPI import PaymentAPI # Create a PaymentAPI object api = PaymentAPI(eid, secret) fees = api.call(function="getFees") print(json.dumps(fees, 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 = { "dummyData" => "dummyValue", }; print(Dumper($api->call("getFees", $values))); 1;

Full example can be found here

Response from server

{ "credentials": { "hash": "cfddebfeae5696db3196ce15b226e8b25d71679c09d4f38ba512faada68cf65aff2997d253722f4ccee3ed132521f7168067e4e6c8d4cd7ca14e7e72d5ec419f", "logid": 1234567 }, "data": [ { "feeid": "12345", "target": "customer", "amount_from": "101", "amount_to": "10000", "duedate_type": "none", "new_duedate": "0000-00-00", "country": "SE", "currency": "SEK", "fee": "1900", "fee_tax": "475", "fee_taxrate": "25", "expiration_date": "0000-00-00", "description": [ { "language": "sv", "description": "Administrationsavgift" }, { "language": "en", "description": "Service Fee" } ] } ] }
Last modified: 13 September 2024