Nostro/packaging/dbus/net.catcrafts.Nostro1.Checkout.xml

54 lines
3.6 KiB
XML
Raw Permalink Normal View History

2026-11-01 18:35:23 +01:00
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<!-- SPDX-License-Identifier: LGPL-3.0-only -->
<!-- SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® -->
<!-- nostro's checkout: how an app has the user's nostro pay an order. The bus name net.catcrafts.Nostro1.Checkout on
the system bus, at /net/catcrafts/Nostro1; a Flatpak app asks for it with the finish-arg
system-talk-name=net.catcrafts.Nostro1.Checkout. C++ programs can use the module Nostro.Checkout (nostro built with
product=checkout) instead. A test in nostro keeps this file the interface nostrod serves.
Pay(payeeIban, payeeName, amount, currency, reference, options) returns (paymentId, results)
payeeIban who is paid: an IBAN, the only payee checkout pays
payeeName their name, as the bank and the prompt show it
amount in the currency's smallest unit (1250 is 12.50), more than zero
currency an ISO code: "EUR"
reference the order's own number, not empty: the payment's description, and what tells orders apart
options none yet; keys nostrod does not know are ignored
paymentId the paying bank's id of the payment
results repeated (b): the order was paid by an earlier call, and nothing was paid now. Later versions may
add keys: ignore the ones you do not know.
nostrod pays the order from the account the user chose for checkouts (nostro checkout account), once the user has
confirmed it at a password prompt that shows the amount, the payee, the reference and that account. The app never
names nor sees the account. Allow interactive authorization on the call, make it asynchronously, and give it a
timeout of minutes: the user may take a while.
An order is paid once. Pay with the same payeeIban and reference again, after a timeout or a crash, answers with
the first payment (repeated is true) without asking the user, or waits for the first call while the user is still
at the prompt; the same reference with another amount is refused. A payment id is not a receipt: confirm the money
arrived with your own bank.
Errors:
net.catcrafts.Nostro1.Error.Cancelled the user did not confirm: nothing was paid
net.catcrafts.Nostro1.Error.NoCheckoutAccount the user has no account chosen to pay checkouts from: nothing was paid
net.catcrafts.Nostro1.Error.InvalidArgument the order was refused before anything was paid
net.catcrafts.Nostro1.Error.Bank the bank refused; its message says when it may have paid all the same
net.catcrafts.Nostro1.Error.Failed anything else, such as an earlier call for this order whose outcome was
lost: it may have been paid
org.freedesktop.DBus.Error.AccessDenied the system's policy refused
org.freedesktop.DBus.Error.InteractiveAuthorizationRequired the call did not allow a password prompt
org.freedesktop.DBus.Error.ServiceUnknown nostro is not installed -->
<node>
<interface name="net.catcrafts.Nostro1.Checkout">
<method name="Pay">
<arg type="s" name="payeeIban" direction="in"/>
<arg type="s" name="payeeName" direction="in"/>
<arg type="x" name="amount" direction="in"/>
<arg type="s" name="currency" direction="in"/>
<arg type="s" name="reference" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="t" name="paymentId" direction="out"/>
<arg type="a{sv}" name="results" direction="out"/>
</method>
</interface>
</node>