From 38dbb494228261735509f9bc2fbe543ed1e0c04e 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: Mon, 13 Mar 2023 13:25:25 +0800 Subject: Checkout takes a copy of the member struct --- interchange/ord.h | 2 +- ord.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/interchange/ord.h b/interchange/ord.h index b6d00a4..7141e11 100644 --- a/interchange/ord.h +++ b/interchange/ord.h @@ -44,7 +44,7 @@ void interchange_ord_order(const char *sku, * arrange the data into the product. */ void interchange_ord_checkout(const char *order_profile, - const struct interchange_member *member, + struct interchange_member member, void (*handler)(interchange_response *)); void interchange_ord_free_order(struct interchange_ord_order *order); diff --git a/ord.c b/ord.c index c793a48..38a6aba 100644 --- a/ord.c +++ b/ord.c @@ -12,24 +12,24 @@ void interchange_ord_order(const char *sku, } void interchange_ord_checkout(const char *order_profile, - const struct interchange_member *member, + struct interchange_member member, void (*handler)(interchange_response *)) { request(handler, NULL, &(struct body){ 14, { { "mv_todo", "submit" }, { "mv_action", "refresh" }, { "mv_order_profile", order_profile }, - { "fname", member->fname }, - { "lname", member->lname }, - { "address1", member->address1 }, - { "address2", member->address2 }, - { "city", member->city }, - { "state", member->state }, - { "zip", member->zip }, - { "email", member->email }, - { "phone_day", member->phone_day }, - { "mv_same_billing", member->preferences.mv_same_billing? "1" : "0" }, - { "email_copy", member->preferences.email_copy? "1" : "0" } + { "fname", member.fname }, + { "lname", member.lname }, + { "address1", member.address1 }, + { "address2", member.address2 }, + { "city", member.city }, + { "state", member.state }, + { "zip", member.zip }, + { "email", member.email }, + { "phone_day", member.phone_day }, + { "mv_same_billing", member.preferences.mv_same_billing? "1" : "0" }, + { "email_copy", member.preferences.email_copy? "1" : "0" } }}, "%s", "ord/checkout"); } -- cgit v1.2.3