/AWS1/IF_BDC=>GETPAYMENTINSTRUMENTBALANCE()¶
About GetPaymentInstrumentBalance¶
Get the balance of a payment instrument.
Method Signature¶
METHODS /AWS1/IF_BDC~GETPAYMENTINSTRUMENTBALANCE
IMPORTING
!IV_USERID TYPE /AWS1/BDCUSERID OPTIONAL
!IV_AGENTNAME TYPE /AWS1/BDCPAYMENTAGENTNAME OPTIONAL
!IV_PAYMENTMANAGERARN TYPE /AWS1/BDCPAYMENTMANAGERARN OPTIONAL
!IV_PAYMENTCONNECTORID TYPE /AWS1/BDCPAYMENTCONNECTORID OPTIONAL
!IV_PAYMENTINSTRUMENTID TYPE /AWS1/BDCPAYMENTINSTRUMENTID OPTIONAL
!IV_CHAIN TYPE /AWS1/BDCBLOCKCHAINCHAINID OPTIONAL
!IV_TOKEN TYPE /AWS1/BDCINSTRMBALANCETOKEN OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdcgtpmntinstrmbale01
RAISING
/AWS1/CX_BDCACCESSDENIEDEX
/AWS1/CX_BDCINTERNALSERVEREX
/AWS1/CX_BDCRESOURCENOTFOUNDEX
/AWS1/CX_BDCTHROTTLINGEX
/AWS1/CX_BDCVALIDATIONEX
/AWS1/CX_BDCCLIENTEXC
/AWS1/CX_BDCSERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
iv_paymentmanagerarn TYPE /AWS1/BDCPAYMENTMANAGERARN /AWS1/BDCPAYMENTMANAGERARN¶
The ARN of the payment manager that owns this payment instrument.
iv_paymentconnectorid TYPE /AWS1/BDCPAYMENTCONNECTORID /AWS1/BDCPAYMENTCONNECTORID¶
The ID of the payment connector associated with this instrument.
iv_paymentinstrumentid TYPE /AWS1/BDCPAYMENTINSTRUMENTID /AWS1/BDCPAYMENTINSTRUMENTID¶
The ID of the payment instrument to query balance for.
iv_chain TYPE /AWS1/BDCBLOCKCHAINCHAINID /AWS1/BDCBLOCKCHAINCHAINID¶
The specific blockchain chain to query balance on. Required because balances are chain-specific.
iv_token TYPE /AWS1/BDCINSTRMBALANCETOKEN /AWS1/BDCINSTRMBALANCETOKEN¶
The token to query balance for. Only tokens supported for X402 payments are returned.
Optional arguments:¶
iv_userid TYPE /AWS1/BDCUSERID /AWS1/BDCUSERID¶
The user ID associated with this payment instrument.
iv_agentname TYPE /AWS1/BDCPAYMENTAGENTNAME /AWS1/BDCPAYMENTAGENTNAME¶
The agent name associated with this request, used for observability.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_bdcgtpmntinstrmbale01 /AWS1/CL_BDCGTPMNTINSTRMBALE01¶
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->getpaymentinstrumentbalance(
iv_agentname = |string|
iv_chain = |string|
iv_paymentconnectorid = |string|
iv_paymentinstrumentid = |string|
iv_paymentmanagerarn = |string|
iv_token = |string|
iv_userid = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_paymentinstrumentid = lo_result->get_paymentinstrumentid( ).
lo_tokenbalance = lo_result->get_tokenbalance( ).
IF lo_tokenbalance IS NOT INITIAL.
lv_string = lo_tokenbalance->get_amount( ).
lv_integer = lo_tokenbalance->get_decimals( ).
lv_instrumentbalancetoken = lo_tokenbalance->get_token( ).
lv_cryptowalletnetwork = lo_tokenbalance->get_network( ).
lv_blockchainchainid = lo_tokenbalance->get_chain( ).
ENDIF.
ENDIF.