gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-exchange] branch master updated: Wire-plugin interfa


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: Wire-plugin interface.
Date: Mon, 23 Jul 2018 14:33:05 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 6df3227  Wire-plugin interface.
6df3227 is described below

commit 6df3227c241e360b84accabff03a8d316ad2af21
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Jul 23 14:32:20 2018 +0200

    Wire-plugin interface.
    
    Add methods signatures to register merchants at banking institutions.
---
 src/include/taler_exchangedb_plugin.h     | 18 ++++++++------
 src/include/taler_wire_plugin.h           | 39 +++++++++++++++++++++++++++++++
 src/wire-plugins/plugin_wire_taler-bank.c |  1 +
 3 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/src/include/taler_exchangedb_plugin.h 
b/src/include/taler_exchangedb_plugin.h
index 2b2d430..6e59473 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -716,13 +716,17 @@ typedef int
  * Callback used to process data of a merchant under KYC monitoring.
  *
  * @param cls closure
- * @param payto_url payto URL of this particular merchant (bank account)
- * @param general_id general identificator valid at the KYC-caring institution
- * @param kyc_checked status of KYC check: if GNUNET_OK, the merchant was
- *        checked at least once, never otherwise.
- * @param merchant_serial_id serial ID identifying this merchant (bank
- *        account) into the database system; it helps making more efficient
- *        queries instead of the payto URL.
+ * @param payto_url payto URL of this particular
+ *        merchant (bank account)
+ * @param general_id general identificator valid
+ *        at the KYC-caring institution
+ * @param kyc_checked status of KYC check:
+ *        if GNUNET_OK, the merchant was checked at least once,
+ *        never otherwise.
+ * @param merchant_serial_id serial ID identifying
+ *        this merchant (bank account) into the database system;
+ *        it helps making more efficient queries than the payto
+ *        URL.
  */
 typedef void
 (*TALER_EXCHANGEDB_KycStatusCallback)(void *cls,
diff --git a/src/include/taler_wire_plugin.h b/src/include/taler_wire_plugin.h
index 2758d2d..ddbb725 100644
--- a/src/include/taler_wire_plugin.h
+++ b/src/include/taler_wire_plugin.h
@@ -41,6 +41,17 @@ typedef void
 
 
 /**
+ * Callback to process a merchant registration outcome.
+ *
+ * @param cls closure
+ * @param status GNUNET_OK if the registration succeeded,
+ *        GNUNET_NO otherwise.
+ */
+typedef void
+(*TALER_WIRE_MerchantRegisterCallback) (void *cls,
+                                        unsigned int status);
+
+/**
  * Details about a valid wire transfer to the exchange.
  * It is the plugin's responsibility to filter and undo
  * invalid transfers.
@@ -356,6 +367,34 @@ struct TALER_WIRE_Plugin
                             struct TALER_WIRE_RejectHandle *rh);
 
 
+  /**
+   * Ask the plugin which data is needed to register the merchant
+   * into the banking institution.
+   *
+   * @param enc[out] where to store the JSON formatted list of
+   *        needed values.  The merchant will use this list to
+   *        show a HTML form to the business in order to collect that data.
+   *        This value will have to be freed by the caller.
+   * @return GNUNET_OK upon successful `enc' allocation and definition,
+   *         GNUNET_NO if _no_ data is needed at all, GNUNET_SYSERR
+   *         for all the other cases.
+   */
+  int
+  (*merchant_data)(void);
+
+  /**
+   * Send data to the banking institution in order to get the
+   * merchant registered.
+   *
+   * @param cls closure
+   * @param body subset of information to be sent to the bank.
+   *        The plugin implementation is free to modify this value.
+   * @param mrcb Callback to process the outcome.
+   */
+  struct TALER_WIRE_MerchantRegisterHandle *
+  (*merchant_register)(void *cls,
+                       const char *body,
+                       TALER_WIRE_MerchantRegisterCallback mrcb);
 };
 
 
diff --git a/src/wire-plugins/plugin_wire_taler-bank.c 
b/src/wire-plugins/plugin_wire_taler-bank.c
index c2282bc..2c967a1 100644
--- a/src/wire-plugins/plugin_wire_taler-bank.c
+++ b/src/wire-plugins/plugin_wire_taler-bank.c
@@ -712,6 +712,7 @@ taler_bank_execute_wire_transfer (void *cls,
   origin_account_url = &buf[sizeof (struct BufFormatP)];
   left = buf_size - sizeof (struct BufFormatP);
   slen = strlen (origin_account_url) + 1;
+  /* make sure there's enough space to accomodate what's been taken now */
   GNUNET_assert (left >= slen);
   left -= slen;
   if (0 == left)

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]