Get due payments
This is the example for getDuePayments. The documentation for can be found here
{
"credentials": {
"id": "12345",
"hash": "f3061b99a05366a299841cdf5ea7114af9b28042a1fc6435e28be4cff060aa52db1eec54871fed93c1cb1fe25d1f505f197a9cd71f0878c870dfb5e394228f3a",
"version": "2.5.0",
"client": "Pluginname:Qvickly:1.0",
"language": "sv",
"time": 1714926964.203058
},
"data": {
"dummyData": 1714926964203000000
},
"function": "getDuePayments"
}
<?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']);
$payments = $paymentAPI->getDuePayments();
print_r($payments);
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();
/* Customer Data */
/**
* @param array Customer Data : Customer details.
*/
$values = array(
"dueDate" => "2020-01-01"
);
echo json_encode($api->getDuePayments($values), JSON_PRETTY_PRINT);
Full example can be found here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BillmateAPI;
namespace GetDuePayments
{
class Program
{
static void Main(string[] args)
{
try
{
Boolean ssl = false;
Dictionary referrer = new Dictionary();
referrer["HTTP_X_REAL_IP"] = "127.0.0.1";
Billmate bm = new Billmate("12345", "123451234512", ssl, true, false, referrer);
bm.Client = "Pluginname:Qvickly:1.0";
bm.Server = "2.5.0";
bm.Language = "sv";
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters["dueDate"] = "2020-01-01";
Dictionary<string, object> result = bm.Call("getDuePayments", parameters);
// Output it in Console
result.ToList().ForEach(x => Console.WriteLine(x.Key + ":" + x.Value));
}
catch (BillmateException be) {
Console.WriteLine(be.ErrorMessage);
Console.WriteLine(be.ErrorLogs);
}
Console.ReadLine();
}
}
}
import { QvicklyPaymentAPI } from "../../PaymentAPI.js";
const paymentAPI = new QvicklyPaymentAPI(process.env.EID, process.env.SECRET);
const payments = await paymentAPI.call("getDuePayments", {
dueDate: "2024-05-01",
});
console.log(payments);
Full example can be found here
import {QvicklyPaymentAPI, env} from "../../PaymentAPI.ts";
const paymentAPI = new QvicklyPaymentAPI(env["EID"], env["SECRET"]);
const payments = await paymentAPI.call("getDuePayments", {
dueDate: "2024-05-01",
});
console.log(payments);
Full example can be found here
import QvicklyPaymentAPI from "../../PaymentAPI";
const paymentAPI = new QvicklyPaymentAPI(Bun.env.EID, Bun.env.SECRET);
const payments = await paymentAPI.call("getDuePayments", {
dueDate: "2024-05-01",
});
console.log(payments);
Full example can be found here
from PaymentAPI import PaymentAPI
# Create a PaymentAPI object
api = PaymentAPI(eid, secret)
payments = api.call(function="getDuePayments", data={"dueDate":"2024-05-01"})
print(json.dumps(payments, 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("getDuePayments", $values)));
1;
Full example can be found here
Response from server
{
"credentials": {
"hash": "edbbb1411422ac0d1cbc5e3a1b8948d01edaa4553ea7a78c1aad823db9f49acbc0b6f9d02769cae8975fe5f44bba13050a5b9c2e19f0f488b9faa7df66029520"
},
"data": [
{
"number": "4833",
"orderid": "P123456997",
"invoiceDate": "2020-01-21",
"invoiceStatus": "Collection",
"dueDate": "2020-02-04",
"topay": "5000"
},
{
"number": "9864",
"orderid": "P84456997",
"invoiceDate": "2020-01-01",
"invoiceStatus": "Due",
"dueDate": "2020-01-18",
"topay": "200"
}
]
}
Last modified: 13 September 2024