aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-01-21 19:21:45 +0100
committerChristian Grothoff <christian@grothoff.org>2018-01-21 19:21:45 +0100
commit3f930c0f6aadc68c98fbe5f2b4824db9a61fc62a (patch)
tree6ab227f0e632b2c7d992a453d68180f12fe95ec6 /src/exchange-lib
parenta252daa6a1b3fe5b22757e7aeffc502e7f098261 (diff)
more wire transfer variants
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/testing_api_cmd_fakebank_transfer.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/exchange-lib/testing_api_cmd_fakebank_transfer.c b/src/exchange-lib/testing_api_cmd_fakebank_transfer.c
index 588eb6721..eb8c6802c 100644
--- a/src/exchange-lib/testing_api_cmd_fakebank_transfer.c
+++ b/src/exchange-lib/testing_api_cmd_fakebank_transfer.c
@@ -318,4 +318,86 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
}
+/**
+ * Create fakebank_transfer command with custom subject.
+ *
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_fakebank_transfer_with_subject (const char *label,
+ const char *amount,
+ uint64_t debit_account_no,
+ uint64_t credit_account_no,
+ const char *auth_username,
+ const char *auth_password,
+ const char *subject)
+{
+ struct TALER_TESTING_Command cmd;
+ struct FakebankTransferState *fts;
+
+ fts = GNUNET_new (struct FakebankTransferState);
+ fts->credit_account_no = credit_account_no;
+ fts->debit_account_no = debit_account_no;
+ fts->auth_username = auth_username;
+ fts->auth_password = auth_password;
+ fts->subject = subject;
+ if (GNUNET_OK !=
+ TALER_string_to_amount (amount,
+ &fts->amount))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse amount `%s' at %s\n",
+ amount,
+ label);
+ GNUNET_assert (0);
+ }
+ cmd.cls = fts;
+ cmd.label = label;
+ cmd.run = &fakebank_transfer_run;
+ cmd.cleanup = &fakebank_transfer_cleanup;
+ cmd.traits = &fakebank_transfer_traits;
+ return cmd;
+}
+
+
+/**
+ * Create fakebank_transfer command with custom subject.
+ *
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_fakebank_transfer_with_ref (const char *label,
+ const char *amount,
+ uint64_t debit_account_no,
+ uint64_t credit_account_no,
+ const char *auth_username,
+ const char *auth_password,
+ const char *ref)
+{
+ struct TALER_TESTING_Command cmd;
+ struct FakebankTransferState *fts;
+
+ fts = GNUNET_new (struct FakebankTransferState);
+ fts->credit_account_no = credit_account_no;
+ fts->debit_account_no = debit_account_no;
+ fts->auth_username = auth_username;
+ fts->auth_password = auth_password;
+ fts->reserve_reference = ref;
+ if (GNUNET_OK !=
+ TALER_string_to_amount (amount,
+ &fts->amount))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed to parse amount `%s' at %s\n",
+ amount,
+ label);
+ GNUNET_assert (0);
+ }
+ cmd.cls = fts;
+ cmd.label = label;
+ cmd.run = &fakebank_transfer_run;
+ cmd.cleanup = &fakebank_transfer_cleanup;
+ cmd.traits = &fakebank_transfer_traits;
+ return cmd;
+}
+
+
/* end of testing_api_cmd_fakebank_transfer.c */