-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da9fb43
commit 80d5fcc
Showing
8 changed files
with
1,060 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use blockchyp; | ||
use std::error::Error; | ||
|
||
fn card_metadata_example() -> Result<(), Box<dyn Error>> { | ||
// sample credentials | ||
let creds = blockchyp::APICredentials { | ||
api_key: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q".to_string(), | ||
bearer_token: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U".to_string(), | ||
signing_key: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947".to_string(), | ||
}; | ||
|
||
// instantiate the client | ||
let client = blockchyp::Client::new(creds); | ||
|
||
let mut request = blockchyp::CardMetadataRequest{ | ||
test: true, | ||
terminal_name: "Test Terminal".to_string(), | ||
..Default::default() | ||
}; | ||
let (response, err) = client.card_metadata(&mut request); | ||
|
||
if let Some(e) = err { | ||
eprintln!("Unexpected error occurred: {:?}", e); | ||
return Err(e) | ||
} | ||
|
||
if response.success { | ||
println!("success"); | ||
} | ||
|
||
println!("Response: {:?}", response); | ||
Ok(()) | ||
} | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
card_metadata_example()?; | ||
println!("Example completed successfully!"); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use blockchyp; | ||
use std::error::Error; | ||
|
||
fn submit_application_example() -> Result<(), Box<dyn Error>> { | ||
// sample credentials | ||
let creds = blockchyp::APICredentials { | ||
api_key: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q".to_string(), | ||
bearer_token: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U".to_string(), | ||
signing_key: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947".to_string(), | ||
}; | ||
|
||
// instantiate the client | ||
let client = blockchyp::Client::new(creds); | ||
|
||
let request = blockchyp::SubmitApplicationRequest{ | ||
|
||
..Default::default() | ||
}; | ||
let (response, err) = client.submit_application(&request); | ||
|
||
if let Some(e) = err { | ||
eprintln!("Unexpected error occurred: {:?}", e); | ||
return Err(e) | ||
} | ||
|
||
if response.success { | ||
println!("Success"); | ||
} | ||
|
||
println!("Response: {:?}", response); | ||
Ok(()) | ||
} | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
submit_application_example()?; | ||
println!("Example completed successfully!"); | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.