Skip to content

/AWS1/IF_BDC=>GETPAYMENTINSTRUMENT()

About GetPaymentInstrument

Get a payment instrument by ID.

Method Signature

METHODS /AWS1/IF_BDC~GETPAYMENTINSTRUMENT
  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
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdcgetpmntinstrmrsp
  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_paymentinstrumentid TYPE /AWS1/BDCPAYMENTINSTRUMENTID /AWS1/BDCPAYMENTINSTRUMENTID

The ID of the payment instrument to retrieve.

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.

iv_paymentconnectorid TYPE /AWS1/BDCPAYMENTCONNECTORID /AWS1/BDCPAYMENTCONNECTORID

The ID of the payment connector.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdcgetpmntinstrmrsp /AWS1/CL_BDCGETPMNTINSTRMRSP

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->getpaymentinstrument(
  iv_agentname = |string|
  iv_paymentconnectorid = |string|
  iv_paymentinstrumentid = |string|
  iv_paymentmanagerarn = |string|
  iv_userid = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lo_paymentinstrument = lo_result->get_paymentinstrument( ).
  IF lo_paymentinstrument IS NOT INITIAL.
    lv_paymentinstrumentid = lo_paymentinstrument->get_paymentinstrumentid( ).
    lv_paymentmanagerarn = lo_paymentinstrument->get_paymentmanagerarn( ).
    lv_paymentconnectorid = lo_paymentinstrument->get_paymentconnectorid( ).
    lv_userid = lo_paymentinstrument->get_userid( ).
    lv_paymentinstrumenttype = lo_paymentinstrument->get_paymentinstrumenttype( ).
    lo_paymentinstrumentdetail = lo_paymentinstrument->get_paymentinstrumentdetails( ).
    IF lo_paymentinstrumentdetail IS NOT INITIAL.
      lo_embeddedcryptowallet = lo_paymentinstrumentdetail->get_embeddedcryptowallet( ).
      IF lo_embeddedcryptowallet IS NOT INITIAL.
        lv_cryptowalletnetwork = lo_embeddedcryptowallet->get_network( ).
        LOOP AT lo_embeddedcryptowallet->get_linkedaccounts( ) into lo_row.
          lo_row_1 = lo_row.
          IF lo_row_1 IS NOT INITIAL.
            lo_linkedaccountemail = lo_row_1->get_email( ).
            IF lo_linkedaccountemail IS NOT INITIAL.
              lv_email = lo_linkedaccountemail->get_emailaddress( ).
            ENDIF.
            lo_linkedaccountsms = lo_row_1->get_sms( ).
            IF lo_linkedaccountsms IS NOT INITIAL.
              lv_phonenumber = lo_linkedaccountsms->get_phonenumber( ).
            ENDIF.
            lo_linkedaccountdeveloperj = lo_row_1->get_developerjwt( ).
            IF lo_linkedaccountdeveloperj IS NOT INITIAL.
              lv_jwtkeyid = lo_linkedaccountdeveloperj->get_kid( ).
              lv_string = lo_linkedaccountdeveloperj->get_sub( ).
            ENDIF.
            lo_linkedaccountoauth2 = lo_row_1->get_oauth2( ).
            IF lo_linkedaccountoauth2 IS NOT INITIAL.
              lo_oauth2authentication = lo_linkedaccountoauth2->get_google( ).
              IF lo_oauth2authentication IS NOT INITIAL.
                lv_string = lo_oauth2authentication->get_sub( ).
                lv_email = lo_oauth2authentication->get_emailaddress( ).
                lv_string = lo_oauth2authentication->get_name( ).
                lv_string = lo_oauth2authentication->get_username( ).
              ENDIF.
              lo_oauth2authentication = lo_linkedaccountoauth2->get_apple( ).
              IF lo_oauth2authentication IS NOT INITIAL.
                lv_string = lo_oauth2authentication->get_sub( ).
                lv_email = lo_oauth2authentication->get_emailaddress( ).
                lv_string = lo_oauth2authentication->get_name( ).
                lv_string = lo_oauth2authentication->get_username( ).
              ENDIF.
              lo_oauth2authentication = lo_linkedaccountoauth2->get_x( ).
              IF lo_oauth2authentication IS NOT INITIAL.
                lv_string = lo_oauth2authentication->get_sub( ).
                lv_email = lo_oauth2authentication->get_emailaddress( ).
                lv_string = lo_oauth2authentication->get_name( ).
                lv_string = lo_oauth2authentication->get_username( ).
              ENDIF.
              lo_oauth2authentication = lo_linkedaccountoauth2->get_telegram( ).
              IF lo_oauth2authentication IS NOT INITIAL.
                lv_string = lo_oauth2authentication->get_sub( ).
                lv_email = lo_oauth2authentication->get_emailaddress( ).
                lv_string = lo_oauth2authentication->get_name( ).
                lv_string = lo_oauth2authentication->get_username( ).
              ENDIF.
              lo_oauth2authentication = lo_linkedaccountoauth2->get_github( ).
              IF lo_oauth2authentication IS NOT INITIAL.
                lv_string = lo_oauth2authentication->get_sub( ).
                lv_email = lo_oauth2authentication->get_emailaddress( ).
                lv_string = lo_oauth2authentication->get_name( ).
                lv_string = lo_oauth2authentication->get_username( ).
              ENDIF.
            ENDIF.
          ENDIF.
        ENDLOOP.
        lv_string = lo_embeddedcryptowallet->get_walletaddress( ).
        lv_string = lo_embeddedcryptowallet->get_redirecturl( ).
      ENDIF.
    ENDIF.
    lv_datetimestamp = lo_paymentinstrument->get_createdat( ).
    lv_paymentinstrumentstatus = lo_paymentinstrument->get_status( ).
    lv_datetimestamp = lo_paymentinstrument->get_updatedat( ).
  ENDIF.
ENDIF.