Skip to content

/AWS1/IF_BDC=>PROCESSPAYMENT()

About ProcessPayment

Processes a payment using a payment instrument within a payment session.

Method Signature

METHODS /AWS1/IF_BDC~PROCESSPAYMENT
  IMPORTING
    !IV_USERID TYPE /AWS1/BDCUSERID OPTIONAL
    !IV_AGENTNAME TYPE /AWS1/BDCPAYMENTAGENTNAME OPTIONAL
    !IV_PAYMENTMANAGERARN TYPE /AWS1/BDCPAYMENTMANAGERARN OPTIONAL
    !IV_PAYMENTSESSIONID TYPE /AWS1/BDCPAYMENTSESSIONID OPTIONAL
    !IV_PAYMENTINSTRUMENTID TYPE /AWS1/BDCPAYMENTINSTRUMENTID OPTIONAL
    !IV_PAYMENTTYPE TYPE /AWS1/BDCPAYMENTTYPE OPTIONAL
    !IO_PAYMENTINPUT TYPE REF TO /AWS1/CL_BDCPAYMENTINPUT OPTIONAL
    !IV_CLIENTTOKEN TYPE /AWS1/BDCCLIENTTOKEN OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_bdcprocesspaymentrsp
  RAISING
    /AWS1/CX_BDCACCESSDENIEDEX
    /AWS1/CX_BDCCONFLICTEXCEPTION
    /AWS1/CX_BDCINTERNALSERVEREX
    /AWS1/CX_BDCSERVICEQUOTAEXCDEX
    /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.

iv_paymentsessionid TYPE /AWS1/BDCPAYMENTSESSIONID /AWS1/BDCPAYMENTSESSIONID

The ID of the payment session.

iv_paymentinstrumentid TYPE /AWS1/BDCPAYMENTINSTRUMENTID /AWS1/BDCPAYMENTINSTRUMENTID

The ID of the payment instrument to use.

iv_paymenttype TYPE /AWS1/BDCPAYMENTTYPE /AWS1/BDCPAYMENTTYPE

The type of payment to process.

io_paymentinput TYPE REF TO /AWS1/CL_BDCPAYMENTINPUT /AWS1/CL_BDCPAYMENTINPUT

The payment input details specific to the payment type.

Optional arguments:

iv_userid TYPE /AWS1/BDCUSERID /AWS1/BDCUSERID

The user ID associated with this payment.

iv_agentname TYPE /AWS1/BDCPAYMENTAGENTNAME /AWS1/BDCPAYMENTAGENTNAME

The agent name associated with this request, used for observability.

iv_clienttoken TYPE /AWS1/BDCCLIENTTOKEN /AWS1/BDCCLIENTTOKEN

A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

RETURNING

oo_output TYPE REF TO /aws1/cl_bdcprocesspaymentrsp /AWS1/CL_BDCPROCESSPAYMENTRSP

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->processpayment(
  io_paymentinput = new /aws1/cl_bdcpaymentinput(
    io_cryptox402 = new /aws1/cl_bdccryptox402pmntinp(
      io_payload = /AWS1/CL_RT_DOCUMENT=>FROM_JSON_STR( |\{"foo":"this is a JSON object..."\}| )
      iv_version = |string|
    )
  )
  iv_agentname = |string|
  iv_clienttoken = |string|
  iv_paymentinstrumentid = |string|
  iv_paymentmanagerarn = |string|
  iv_paymentsessionid = |string|
  iv_paymenttype = |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_processpaymentid = lo_result->get_processpaymentid( ).
  lv_paymentmanagerarn = lo_result->get_paymentmanagerarn( ).
  lv_paymentsessionid = lo_result->get_paymentsessionid( ).
  lv_paymentinstrumentid = lo_result->get_paymentinstrumentid( ).
  lv_paymenttype = lo_result->get_paymenttype( ).
  lv_paymentstatus = lo_result->get_status( ).
  lo_paymentoutput = lo_result->get_paymentoutput( ).
  IF lo_paymentoutput IS NOT INITIAL.
    lo_cryptox402paymentoutput = lo_paymentoutput->get_cryptox402( ).
    IF lo_cryptox402paymentoutput IS NOT INITIAL.
      lv_string = lo_cryptox402paymentoutput->get_version( ).
      lo_value = lo_cryptox402paymentoutput->get_payload( ).
      IF lo_value IS NOT INITIAL.
      ENDIF.
    ENDIF.
  ENDIF.
  lv_datetimestamp = lo_result->get_createdat( ).
  lv_datetimestamp = lo_result->get_updatedat( ).
ENDIF.