Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing encoded invoice #45

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lightspark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "lightspark"
description = "Lightspark Rust SDK"
authors = ["Lightspark Group, Inc. <[email protected]>"]
version = "0.8.1"
version = "0.8.2"
edition = "2021"
documentation = "https://docs.lightspark.com/lightspark-sdk/getting-started?language=Rust"
homepage = "https://www.lightspark.com/"
Expand Down
2 changes: 1 addition & 1 deletion lightspark/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lightspark Rust SDK - v0.8.1
# Lightspark Rust SDK - v0.8.2

The Lightspark Rust SDK provides a convenient way to interact with the Lightspark services from applications written in the Rust language.

Expand Down
6 changes: 4 additions & 2 deletions lightspark/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,10 @@ impl<K: OperationSigningKey> LightsparkClient<K> {
.execute_graphql(mutation, Some(value))
.await?;

let result = json["create_test_mode_invoice"]["encoded_payment_request"].clone();
Ok(result.to_string())
Ok(json["create_test_mode_invoice"]["encoded_payment_request"]
.as_str()
.ok_or_else(|| Error::GraphqlError("unable to parse the encoded invoice".into()))?
.to_owned())
}

pub async fn create_test_mode_payment(
Expand Down
Loading