Struct Payment

Source
pub struct Payment {}

Implementations§

Source§

impl Payment

Source

pub fn register_method( payment_method: &str, create_payment_address: Option<CreatePaymentAddressCB>, add_request_fees: Option<AddRequestFeesCB>, parse_response_with_fees: Option<ParseResponseWithFeesCB>, build_get_payment_sources_request: Option<BuildGetPaymentSourcesRequestCB>, parse_get_payment_sources_response: Option<ParseGetPaymentSourcesResponseCB>, build_payment_req: Option<BuildPaymentReqCB>, parse_payment_response: Option<ParsePaymentResponseCB>, build_mint_req: Option<BuildMintReqCB>, build_set_txn_fees_req: Option<BuildSetTxnFeesReqCB>, build_get_txn_fees_req: Option<BuildGetTxnFeesReqCB>, parse_get_txn_fees_response: Option<ParseGetTxnFeesResponseCB>, build_verify_payment_req: Option<BuildVerifyPaymentReqCB>, parse_verify_payment_response: Option<ParseVerifyPaymentResponseCB>, ) -> Result<(), ErrorCode>

Source

pub fn register_method_timeout( payment_method: &str, create_payment_address: Option<CreatePaymentAddressCB>, add_request_fees: Option<AddRequestFeesCB>, parse_response_with_fees: Option<ParseResponseWithFeesCB>, build_get_payment_sources_request: Option<BuildGetPaymentSourcesRequestCB>, parse_get_payment_sources_response: Option<ParseGetPaymentSourcesResponseCB>, build_payment_req: Option<BuildPaymentReqCB>, parse_payment_response: Option<ParsePaymentResponseCB>, build_mint_req: Option<BuildMintReqCB>, build_set_txn_fees_req: Option<BuildSetTxnFeesReqCB>, build_get_txn_fees_req: Option<BuildGetTxnFeesReqCB>, parse_get_txn_fees_response: Option<ParseGetTxnFeesResponseCB>, build_verify_payment_req: Option<BuildVerifyPaymentReqCB>, parse_verify_payment_response: Option<ParseVerifyPaymentResponseCB>, timeout: Duration, ) -> Result<(), ErrorCode>

  • timeout - the maximum time this function waits for a response
Source

pub fn register_method_async<F>( payment_method: &str, create_payment_address: Option<CreatePaymentAddressCB>, add_request_fees: Option<AddRequestFeesCB>, parse_response_with_fees: Option<ParseResponseWithFeesCB>, build_get_payment_sources_request: Option<BuildGetPaymentSourcesRequestCB>, parse_get_payment_sources_response: Option<ParseGetPaymentSourcesResponseCB>, build_payment_req: Option<BuildPaymentReqCB>, parse_payment_response: Option<ParsePaymentResponseCB>, build_mint_req: Option<BuildMintReqCB>, build_set_txn_fees_req: Option<BuildSetTxnFeesReqCB>, build_get_txn_fees_req: Option<BuildGetTxnFeesReqCB>, parse_get_txn_fees_response: Option<ParseGetTxnFeesResponseCB>, build_verify_payment_req: Option<BuildVerifyPaymentReqCB>, parse_verify_payment_response: Option<ParseVerifyPaymentResponseCB>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode) + Send + 'static,

  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn create_payment_address( wallet_handle: IndyHandle, payment_method: &str, config: &str, ) -> Result<String, ErrorCode>

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

§Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
§Example

config { seed: , // allows deterministic creation of payment address }

§Returns
  • payment_address - public identifier of payment address in fully resolvable payment address format
Source

pub fn create_payment_address_timeout( wallet_handle: IndyHandle, payment_method: &str, config: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

§Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
  • timeout - the maximum time this function waits for a response
§Example

config { seed: , // allows deterministic creation of payment address }

§Returns
  • payment_address - public identifier of payment address in fully resolvable payment address format
Source

pub fn create_payment_address_async<F>( wallet_handle: IndyHandle, payment_method: &str, config: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Create the payment address for specified payment method

This method generates private part of payment address and stores it in a secure place. Ideally it should be secret in libindy wallet (see crypto module).

Note that payment method should be able to resolve this secret by fully resolvable payment address format.

§Arguments
  • wallet_handle - wallet handle where to save new address
  • payment_method - payment method to use (for example, ‘sov’)
  • config - payment address config as json
  • closure - the closure that is called when finished
§Example

config { seed: , // allows deterministic creation of payment address }

§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn list_payment_addresses( wallet_handle: IndyHandle, ) -> Result<String, ErrorCode>

Lists all payment addresses that are stored in the wallet

§Arguments
  • wallet_handle - wallet to search for payment_addresses
§Returns
  • payment_addresses_json - json array of string with json addresses
Source

pub fn list_payment_addresses_timeout( wallet_handle: IndyHandle, timeout: Duration, ) -> Result<String, ErrorCode>

Lists all payment addresses that are stored in the wallet

§Arguments
  • wallet_handle - wallet to search for payment_addresses
  • timeout - the maximum time this function waits for a response
§Returns
  • payment_addresses_json - json array of string with json addresses
Source

pub fn list_payment_addresses_async<F>( wallet_handle: IndyHandle, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Lists all payment addresses that are stored in the wallet

§Arguments
  • wallet_handle - wallet to search for payment_addresses
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn add_request_fees( wallet_handle: IndyHandle, submitter_did: &str, req_json: &str, inputs_json: &str, outputs_json: &str, extra: Option<&str>, ) -> Result<(String, String), ErrorCode>

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
§Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

§Returns
  • req_with_fees_json - modified Indy request with added fees info
  • payment_method
Source

pub fn add_request_fees_timeout( wallet_handle: IndyHandle, submitter_did: &str, req_json: &str, inputs_json: &str, outputs_json: &str, extra: Option<&str>, timeout: Duration, ) -> Result<(String, String), ErrorCode>

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
  • timeout - the maximum time this function waits for a response
§Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

§Returns
  • req_with_fees_json - modified Indy request with added fees info
  • payment_method
Source

pub fn add_request_fees_async<F>( wallet_handle: IndyHandle, submitter_did: &str, req_json: &str, inputs_json: &str, outputs_json: &str, extra: Option<&str>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String, String) + Send + 'static,

Modifies Indy request by adding information how to pay fees for this transaction according to selected payment method.

Payment selection is performed by looking to o

This method consumes set of UTXO inputs and outputs. The difference between inputs balance and outputs balance is the fee for this transaction.

Not that this method also produces correct fee signatures.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • req_json - initial transaction request as json
  • inputs_json - the list of UTXO inputs as json array
  • closure - the closure that is called when finished
§Examples

inputs_json: [“input1”, …] Notes: - each input should reference paymentAddress - this param will be used to determine payment_method outputs_json: The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]

§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn parse_response_with_fees( payment_method: &str, resp_json: &str, ) -> Result<String, ErrorCode>

Parses response for Indy request with fees.

§Arguments
  • payment_method
  • resp_json: response for Indy request with fees Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json
§Example

utxo_json [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Source

pub fn parse_response_with_fees_timeout( payment_method: &str, resp_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Parses response for Indy request with fees.

§Arguments
  • payment_method
  • resp_json: response for Indy request with fees
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json
§Example

utxo_json [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Source

pub fn parse_response_with_fees_async<F>( payment_method: &str, resp_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Parses response for Indy request with fees.

§Arguments
  • payment_method
  • resp_json: response for Indy request with fees
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_get_payment_sources_request( wallet_handle: IndyHandle, submitter_did: &str, payment_address: &str, ) -> Result<(String, String), ErrorCode>

Builds Indy request for getting UTXO list for payment address according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
§Returns
  • get_utxo_txn_json - Indy request for getting UTXO list for payment address
  • payment_method
Source

pub fn build_get_payment_sources_request_timeout( wallet_handle: IndyHandle, submitter_did: &str, payment_address: &str, timeout: Duration, ) -> Result<(String, String), ErrorCode>

Builds Indy request for getting UTXO list for payment address according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
  • timeout - the maximum time this function waits for a response
§Returns
  • get_utxo_txn_json - Indy request for getting UTXO list for payment address
  • payment_method
Source

pub fn build_get_payment_sources_request_async<F>( wallet_handle: IndyHandle, submitter_did: &str, payment_address: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String, String) + Send + 'static,

Builds Indy request for getting UTXO list for payment address according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_address -: target payment address
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn parse_get_payment_sources_response( payment_method: &str, resp_json: &str, ) -> Result<String, ErrorCode>

Parses response for Indy request for getting UTXO list.

§Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json:
§Examples:

[{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Source

pub fn parse_get_payment_sources_response_timeout( payment_method: &str, resp_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Parses response for Indy request for getting UTXO list.

§Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as json:
§Examples:

[{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]

Source

pub fn parse_get_payment_sources_response_async<F>( payment_method: &str, resp_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Parses response for Indy request for getting UTXO list.

§Arguments
  • payment_method
  • resp_json - response for Indy request for getting UTXO list
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_payment_req( wallet_handle: IndyHandle, submitter_did: &str, inputs: &str, outputs: &str, extra: Option<&str>, ) -> Result<(String, String), ErrorCode>

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
§Returns
  • payment_req_json - Indy request for doing tokens payment
  • payment_method
Source

pub fn build_payment_req_timeout( wallet_handle: IndyHandle, submitter_did: &str, inputs: &str, outputs: &str, extra: Option<&str>, timeout: Duration, ) -> Result<(String, String), ErrorCode>

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • timeout - the maximum time this function waits for a response
§Returns
  • payment_req_json - Indy request for doing tokens payment
  • payment_method
Source

pub fn build_payment_req_async<F>( wallet_handle: IndyHandle, submitter_did: &str, inputs: &str, outputs: &str, extra: Option<&str>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String, String) + Send + 'static,

Builds Indy request for doing tokens payment according to this payment method.

This method consumes set of UTXO inputs and outputs.

Format of inputs is specific for payment method. Usually it should reference payment transaction with at least one output that corresponds to payment address that user owns.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • inputs_json - The list of UTXO inputs as json array: [“input1”, …] Note that each input should reference paymentAddress
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn parse_payment_response( payment_method: &str, resp_json: &str, ) -> Result<String, ErrorCode>

Parses response for Indy request for payment txn.

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as jso-n [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]
Source

pub fn parse_payment_response_timeout( payment_method: &str, resp_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Parses response for Indy request for payment txn.

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn
  • timeout - the maximum time this function waits for a response Note: this param will be used to determine payment_method
§Returns
  • utxo_json - parsed (payment method and node version agnostic) utxo info as jso-n [{ input: , // UTXO input amount: , // amount of tokens in this input extra: , // optional data from payment transaction }]
Source

pub fn parse_payment_response_async<F>( payment_method: &str, resp_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Parses response for Indy request for payment txn.

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for payment txn
  • closure - the closure that is called when finished Note: this param will be used to determine payment_method
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_mint_req( wallet_handle: IndyHandle, submitter_did: &str, outputs_json: &str, extra: Option<&str>, ) -> Result<(String, String), ErrorCode>

Builds Indy request for doing tokens minting according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
§Returns
  • mint_req_json - Indy request for doing tokens minting
  • payment_method
Source

pub fn build_mint_req_timeout( wallet_handle: IndyHandle, submitter_did: &str, outputs_json: &str, extra: Option<&str>, timeout: Duration, ) -> Result<(String, String), ErrorCode>

Builds Indy request for doing tokens minting according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • timeout - the maximum time this function waits for a response
§Returns
  • mint_req_json - Indy request for doing tokens minting
  • payment_method
Source

pub fn build_mint_req_async<F>( wallet_handle: IndyHandle, submitter_did: &str, outputs_json: &str, extra: Option<&str>, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String, String) + Send + 'static,

Builds Indy request for doing tokens minting according to this payment method.

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • outputs_json - The list of UTXO outputs as json array: [{ paymentAddress: , // payment address used as output amount: , // amount of tokens to transfer to this payment address extra: , // optional data }]
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_set_txn_fees_req( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, fees_json: &str, ) -> Result<String, ErrorCode>

Builds Indy request for setting fees for transactions in the ledger

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
§Returns
  • set_txn_fees_json - Indy request for setting fees for transactions in the ledger
Source

pub fn build_set_txn_fees_req_timeout( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, fees_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Builds Indy request for setting fees for transactions in the ledger

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
  • timeout - the maximum time this function waits for a response
§Returns
  • set_txn_fees_json - Indy request for setting fees for transactions in the ledger
Source

pub fn build_set_txn_fees_req_async<F>( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, fees_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Builds Indy request for setting fees for transactions in the ledger

§Arguments
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • fees_json - { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_get_txn_fees_req( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, ) -> Result<String, ErrorCode>

Builds Indy get request for getting fees for transactions in the ledger

§Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
§Returns
  • get_txn_fees_json - Indy request for getting fees for transactions in the ledger
Source

pub fn build_get_txn_fees_req_timeout( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Builds Indy get request for getting fees for transactions in the ledger

§Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • timeout - the maximum time this function waits for a response
§Returns
  • get_txn_fees_json - Indy request for getting fees for transactions in the ledger
Source

pub fn build_get_txn_fees_req_async<F>( wallet_handle: IndyHandle, submitter_did: &str, payment_method: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Builds Indy get request for getting fees for transactions in the ledger

§Arguments
  • command_handle
  • wallet_handle - wallet handle
  • submitter_did - DID of request sender
  • payment_method
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn parse_get_txn_fees_response( payment_method: &str, resp_json: &str, ) -> Result<String, ErrorCode>

Parses response for Indy request for getting fees

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
§Returns
  • fees_json { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
Source

pub fn parse_get_txn_fees_response_timeout( payment_method: &str, resp_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

Parses response for Indy request for getting fees

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
  • timeout - the maximum time this function waits for a response
§Returns
  • fees_json { txnType1: amount1, txnType2: amount2, …………….. txnTypeN: amountN, }
Source

pub fn parse_get_txn_fees_response_async<F>( payment_method: &str, resp_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

Parses response for Indy request for getting fees

§Arguments
  • command_handle
  • payment_method
  • resp_json - response for Indy request for getting fees
  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn build_verify_req( wallet_handle: IndyHandle, submitter_did: &str, receipt: &str, ) -> Result<(String, String), ErrorCode>

Source

pub fn build_verify_req_timeout( wallet_handle: IndyHandle, submitter_did: &str, receipt: &str, timeout: Duration, ) -> Result<(String, String), ErrorCode>

  • timeout - the maximum time this function waits for a response
Source

pub fn build_verify_req_async<F>( wallet_handle: IndyHandle, submitter_did: &str, receipt: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String, String) + Send + 'static,

  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result
Source

pub fn parse_verify_response( payment_method: &str, resp_json: &str, ) -> Result<String, ErrorCode>

Source

pub fn parse_verify_response_timeout( payment_method: &str, resp_json: &str, timeout: Duration, ) -> Result<String, ErrorCode>

  • timeout - the maximum time this function waits for a response
Source

pub fn parse_verify_response_async<F>( payment_method: &str, resp_json: &str, closure: F, ) -> ErrorCode
where F: FnMut(ErrorCode, String) + Send + 'static,

  • closure - the closure that is called when finished
§Returns
  • errorcode - errorcode from calling ffi function. The closure receives the return result

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.