From 66b622c45113134813d3b728a7e543bf1acc7892 Mon Sep 17 00:00:00 2001 From: Gabriel Comte Date: Fri, 29 Nov 2024 13:27:01 +0100 Subject: [PATCH] Add referral code to topup registration --- crow/src/lib.rs | 13 +++++++++++-- graphql/schemas/operations.graphql | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/crow/src/lib.rs b/crow/src/lib.rs index c73b8b9..71a478d 100644 --- a/crow/src/lib.rs +++ b/crow/src/lib.rs @@ -73,8 +73,17 @@ impl OfferManager { Self { backend_url, auth } } - pub fn register_topup(&self, order_id: String, email: Option) -> graphql::Result<()> { - let variables = register_topup::Variables { order_id, email }; + pub fn register_topup( + &self, + order_id: String, + email: Option, + referral_code: Option, + ) -> graphql::Result<()> { + let variables = register_topup::Variables { + order_id, + email, + referral_code, + }; let access_token = self.auth.query_token()?; let client = build_client(Some(&access_token))?; let data = post_blocking::(&client, &self.backend_url, variables)?; diff --git a/graphql/schemas/operations.graphql b/graphql/schemas/operations.graphql index 2ab5df5..0746d73 100644 --- a/graphql/schemas/operations.graphql +++ b/graphql/schemas/operations.graphql @@ -91,8 +91,8 @@ query ListCurrencyCodes { # topups -mutation RegisterTopup($orderId: String!, $email: String){ - register_topup(orderId: $orderId, email: $email) { +mutation RegisterTopup($orderId: String!, $email: String, $referralCode: String){ + register_topup(orderId: $orderId, email: $email, referralCode: $referralCode) { walletPubKeyId, nodePubKey, email,