Skip to content

Commit

Permalink
Merge pull request #122 from getlipa/feature/add-referral-code-to-topup
Browse files Browse the repository at this point in the history
Add referral code to topup registration
  • Loading branch information
gcomte authored Nov 29, 2024
2 parents 185e4e3 + 66b622c commit 8ad85fa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions crow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,17 @@ impl OfferManager {
Self { backend_url, auth }
}

pub fn register_topup(&self, order_id: String, email: Option<String>) -> graphql::Result<()> {
let variables = register_topup::Variables { order_id, email };
pub fn register_topup(
&self,
order_id: String,
email: Option<String>,
referral_code: Option<String>,
) -> 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::<RegisterTopup>(&client, &self.backend_url, variables)?;
Expand Down
4 changes: 2 additions & 2 deletions graphql/schemas/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8ad85fa

Please sign in to comment.