def METHOD_NAME(
    config: ApiConfig, payment_information: PaymentData
) -> PaymentResult:
    action = TRANSACTION_CANCELLATION
    psp_reference = payment_information.psp_reference
    if not psp_reference:
        return error_payment_result(
            add_action_to_code(action, error_code=NO_PSP_REFERENCE)
        )
    result, error_codes = cancel(config, psp_reference)
    if error_codes:
        error_messages = get_error_messages_from_codes(action, error_codes=error_codes)
        return errors_payment_result(error_messages)
    return PaymentResult(status=PaymentStatus.SUCCESS)