diff options
Diffstat (limited to 'src/bank-lib/bank_api_transfer.c')
-rw-r--r-- | src/bank-lib/bank_api_transfer.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/bank-lib/bank_api_transfer.c b/src/bank-lib/bank_api_transfer.c index e8138adbf..61f999701 100644 --- a/src/bank-lib/bank_api_transfer.c +++ b/src/bank-lib/bank_api_transfer.c | |||
@@ -68,7 +68,7 @@ GNUNET_NETWORK_STRUCT_END | |||
68 | /** | 68 | /** |
69 | * Prepare for exeuction of a wire transfer. | 69 | * Prepare for exeuction of a wire transfer. |
70 | * | 70 | * |
71 | * @param destination_account_url payto:// URL identifying where to send the money | 71 | * @param destination_account_payto_uri payto:// URL identifying where to send the money |
72 | * @param amount amount to transfer, already rounded | 72 | * @param amount amount to transfer, already rounded |
73 | * @param exchange_base_url base URL of this exchange (included in subject | 73 | * @param exchange_base_url base URL of this exchange (included in subject |
74 | * to facilitate use of tracking API by merchant backend) | 74 | * to facilitate use of tracking API by merchant backend) |
@@ -77,7 +77,7 @@ GNUNET_NETWORK_STRUCT_END | |||
77 | * @param[out] buf_size set to number of bytes in @a buf, 0 on error | 77 | * @param[out] buf_size set to number of bytes in @a buf, 0 on error |
78 | */ | 78 | */ |
79 | void | 79 | void |
80 | TALER_BANK_prepare_wire_transfer (const char *destination_account_url, | 80 | TALER_BANK_prepare_wire_transfer (const char *destination_account_payto_uri, |
81 | const struct TALER_Amount *amount, | 81 | const struct TALER_Amount *amount, |
82 | const char *exchange_base_url, | 82 | const char *exchange_base_url, |
83 | const struct | 83 | const struct |
@@ -86,7 +86,7 @@ TALER_BANK_prepare_wire_transfer (const char *destination_account_url, | |||
86 | size_t *buf_size) | 86 | size_t *buf_size) |
87 | { | 87 | { |
88 | struct WirePackP *wp; | 88 | struct WirePackP *wp; |
89 | size_t d_len = strlen (destination_account_url) + 1; | 89 | size_t d_len = strlen (destination_account_payto_uri) + 1; |
90 | size_t u_len = strlen (exchange_base_url) + 1; | 90 | size_t u_len = strlen (exchange_base_url) + 1; |
91 | char *end; | 91 | char *end; |
92 | 92 | ||
@@ -101,7 +101,7 @@ TALER_BANK_prepare_wire_transfer (const char *destination_account_url, | |||
101 | wp->exchange_url_len = htonl ((uint32_t) u_len); | 101 | wp->exchange_url_len = htonl ((uint32_t) u_len); |
102 | end = (char *) &wp[1]; | 102 | end = (char *) &wp[1]; |
103 | memcpy (end, | 103 | memcpy (end, |
104 | destination_account_url, | 104 | destination_account_payto_uri, |
105 | d_len); | 105 | d_len); |
106 | memcpy (end + d_len, | 106 | memcpy (end + d_len, |
107 | exchange_base_url, | 107 | exchange_base_url, |
@@ -249,7 +249,6 @@ handle_transfer_finished (void *cls, | |||
249 | */ | 249 | */ |
250 | struct TALER_BANK_WireExecuteHandle * | 250 | struct TALER_BANK_WireExecuteHandle * |
251 | TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, | 251 | TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, |
252 | const char *bank_base_url, | ||
253 | const struct | 252 | const struct |
254 | TALER_BANK_AuthenticationData *auth, | 253 | TALER_BANK_AuthenticationData *auth, |
255 | const void *buf, | 254 | const void *buf, |
@@ -263,7 +262,7 @@ TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, | |||
263 | const struct WirePackP *wp = buf; | 262 | const struct WirePackP *wp = buf; |
264 | uint32_t d_len; | 263 | uint32_t d_len; |
265 | uint32_t u_len; | 264 | uint32_t u_len; |
266 | const char *destination_account_url; | 265 | const char *destination_account_uri; |
267 | const char *exchange_base_url; | 266 | const char *exchange_base_url; |
268 | struct TALER_Amount amount; | 267 | struct TALER_Amount amount; |
269 | 268 | ||
@@ -279,9 +278,9 @@ TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, | |||
279 | GNUNET_break (0); | 278 | GNUNET_break (0); |
280 | return NULL; | 279 | return NULL; |
281 | } | 280 | } |
282 | destination_account_url = (const char *) &wp[1]; | 281 | destination_account_uri = (const char *) &wp[1]; |
283 | exchange_base_url = destination_account_url + d_len; | 282 | exchange_base_url = destination_account_uri + d_len; |
284 | if (NULL == bank_base_url) | 283 | if (NULL == auth->wire_gateway_url) |
285 | { | 284 | { |
286 | GNUNET_break (0); | 285 | GNUNET_break (0); |
287 | return NULL; | 286 | return NULL; |
@@ -291,7 +290,7 @@ TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, | |||
291 | weh = GNUNET_new (struct TALER_BANK_WireExecuteHandle); | 290 | weh = GNUNET_new (struct TALER_BANK_WireExecuteHandle); |
292 | weh->cb = cc; | 291 | weh->cb = cc; |
293 | weh->cb_cls = cc_cls; | 292 | weh->cb_cls = cc_cls; |
294 | weh->request_url = TALER_url_join (bank_base_url, | 293 | weh->request_url = TALER_url_join (auth->wire_gateway_url, |
295 | "transfer", | 294 | "transfer", |
296 | NULL); | 295 | NULL); |
297 | if (NULL == weh->request_url) | 296 | if (NULL == weh->request_url) |
@@ -306,7 +305,7 @@ TALER_BANK_execute_wire_transfer (struct GNUNET_CURL_Context *ctx, | |||
306 | "amount", TALER_JSON_from_amount (&amount), | 305 | "amount", TALER_JSON_from_amount (&amount), |
307 | "exchange_base_url", exchange_base_url, | 306 | "exchange_base_url", exchange_base_url, |
308 | "wtid", GNUNET_JSON_from_data_auto (&wp->wtid), | 307 | "wtid", GNUNET_JSON_from_data_auto (&wp->wtid), |
309 | "credit_account", destination_account_url); | 308 | "credit_account", destination_account_uri); |
310 | if (NULL == transfer_obj) | 309 | if (NULL == transfer_obj) |
311 | { | 310 | { |
312 | GNUNET_break (0); | 311 | GNUNET_break (0); |