From dfa57092e26c242c2ab64dc1d029e5dff44eee67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 17 Jul 2021 11:05:19 +0800 Subject: Rename trx_id to order_number --- anteraja.c | 8 ++++---- pikul.c | 8 ++++---- pikul.h | 2 +- pikul.i | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/anteraja.c b/anteraja.c index 65f7206..b49c07c 100644 --- a/anteraja.c +++ b/anteraja.c @@ -94,7 +94,7 @@ size_t anteraja_services_handle(const char *contents, size_t size, size_t nmemb, return realsize; } -void anteraja_order(const char *trx_id, const char *service, const char *sender_name, +void anteraja_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal, @@ -128,13 +128,13 @@ void anteraja_order(const char *trx_id, const char *service, const char *sender_ else json[strlen(json)] = '\0'; } - *post = malloc(strlen(ORDER_POST) + strlen(prefix) + strlen(trx_id) + strlen(service) + *post = malloc(strlen(ORDER_POST) + strlen(prefix) + strlen(order_number) + strlen(service) + ORDER_WEIGHT + strlen(sender_name) + strlen(sender_phone) + strlen(origin) + strlen(sender_address) + strlen(receiver_name) + strlen(receiver_phone) + strlen(destination) + strlen(receiver_address) + strlen(json) + ORDER_INSURANCE + ORDER_SUBTOTAL - 13 * strlen("%s") - 2 * strlen("%d") + 1); - sprintf(*post, ORDER_POST, prefix, trx_id, service, (int)total_weight, sender_name, sender_phone, - origin, sender_address, receiver_name, receiver_phone, destination, + sprintf(*post, ORDER_POST, prefix, order_number, service, (int)total_weight, sender_name, + sender_phone, origin, sender_address, receiver_name, receiver_phone, destination, receiver_address, json, insurance ? "true" : "false", (int)subtotal); curl_easy_setopt(curl, CURLOPT_POSTFIELDS, *post); } diff --git a/pikul.c b/pikul.c index a08b101..5f04136 100644 --- a/pikul.c +++ b/pikul.c @@ -112,7 +112,7 @@ double pikul_cost(const char *origin, const char *destination, double weight, co return cost; } -char *pikul_order(const char *trx_id, const char *service, const char *sender_name, +char *pikul_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal) @@ -123,9 +123,9 @@ char *pikul_order(const char *trx_id, const char *service, const char *sender_na size_t (*handler)(const char *, size_t, size_t, char **); switch (shipping.company) { case PIKUL_ANTERAJA: - anteraja_order(trx_id, service, sender_name, sender_phone, origin, sender_address, - receiver_name, receiver_phone, destination, receiver_address, - nitems, items, insurance, subtotal, &url, &post); + anteraja_order(order_number, service, sender_name, sender_phone, origin, + sender_address, receiver_name, receiver_phone, destination, + receiver_address, nitems, items, insurance, subtotal, &url, &post); handler = anteraja_order_handle; break; default: diff --git a/pikul.h b/pikul.h index e2c6331..623c87a 100644 --- a/pikul.h +++ b/pikul.h @@ -25,7 +25,7 @@ void pikul_init(enum pikul_company company, char *provisions[]); struct pikul_services *pikul_services(const char *origin, const char *destination, double weight); void pikul_free_services(struct pikul_services *services); double pikul_cost(const char *origin, const char *destination, double weight, const char *service); -char *pikul_order(const char *trx_id, const char *service, const char *sender_name, +char *pikul_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal); diff --git a/pikul.i b/pikul.i index e2d363f..9defe86 100644 --- a/pikul.i +++ b/pikul.i @@ -48,7 +48,7 @@ %rename("%(strip:[pikul_])s") ""; void pikul_init(enum pikul_company company, char *provisions[]); double pikul_cost(const char *origin, const char *destination, double weight, const char *service); -char *pikul_order(const char *trx_id, const char *service, const char *sender_name, +char *pikul_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal); -- cgit v1.2.3